Page MenuHomePhabricator

Can't delete category from redirect
Closed, ResolvedPublic

Description

Author: kusma.wiki

Description:
If I remove the category from the redirect at
http://en.wikipedia.org/wiki/User:Kusma/Test
I get the MySQL error "1062: Duplicate entry '7726156' for key 1 (10.0.0.235)"
from within function "Article::updateRedirectOn" when I try to save. Apparently
some edits to redirects are rejected.


Version: unspecified
Severity: major

Details

Reference
bz7780

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:26 PM
bzimport set Reference to bz7780.

rotemliss wrote:

Quick workaround: change the redirect target and remove the category, then
change it back to the original target. Checking the problem.

rotemliss wrote:

Patch

Here is a patch for that. I tested it, but not enough. I would test it more
later, if someone else doesn't test and commit it.

attachment patch ignored as obsolete

rotemliss wrote:

Patch

Removing some test code.

Attached:

Fixed in r17354; simply using REPLACE instead of trying to UPDATE or INSERT.

The previous code failed because the modified row count from UPDATE is 0
if no rows are *changed* -- so it would come back with its own value.
Putting IGNORE on the INSERT would have also worked, but the extra code
path is just silly; prune it out!