User Merge and Delete plugin

From ShawnReevesWiki
Jump to navigationJump to search

I use User Merge and Delete to manage spammers on this site. Since upgrading MediaWiki, I've noticed that the merge and delete action crashes sometimes, apparently resulting from an attempt by related scripts to change the ipblocks table, confusing the ipb_id with the user_id. Note in the following output from a successful merge and delete that ipblocks is modified twice, even though I think it only appears once in the update sequence in the script body:

Updating archive table (47 to 0)
Updating revision table (47 to 0)
Updating filearchive table (47 to 0)
Updating image table (47 to 0)
Updating oldimage table (47 to 0)
Updating recentchanges table (47 to 0)
Updating logging table (47 to 0)
Updating ipblocks table (47 to 0)
Updating ipblocks table (47 to 0)
Updating watchlist table (47 to 0)
Updating archive table (KimberleyJarvis462 to Anonymous)
Updating revision table (KimberleyJarvis462 to Anonymous)
Updating filearchive table (KimberleyJarvis462 to Anonymous)
Updating image table (KimberleyJarvis462 to Anonymous)
Updating oldimage table (KimberleyJarvis462 to Anonymous)
Updating recentchanges table (KimberleyJarvis462 to Anonymous)
Updating ipblocks table (KimberleyJarvis462 to Anonymous)
Updating ipblocks table (KimberleyJarvis462 to Anonymous)

A non-successful merge and delete yields the following:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
UPDATE `mw_ipblocks` SET ipb_id = '0' WHERE ipb_id = '40'
from within function "DatabaseBase::update". Database returned error "1062: Duplicate entry '0' for key 'PRIMARY' (localhost)".

Note that I was trying to merge a user whose ID was 40 and Anonymous' ID is 0, and user_id is kept as ipb_user, not ipb_id, so something is trying to apply a change to ipb_id mistakenly.