From f6efb8d23e44efa50c53d5a178c3b3946d881d4b Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Tue, 18 May 2010 20:35:25 +0000 Subject: [PATCH] Use ID instead of (namespace,title) for the update statement, fix reporting --- maintenance/namespaceDupes.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/maintenance/namespaceDupes.php b/maintenance/namespaceDupes.php index dee2d28122..5cb331dee4 100644 --- a/maintenance/namespaceDupes.php +++ b/maintenance/namespaceDupes.php @@ -200,7 +200,8 @@ class NamespaceConflictChecker extends Maintenance { $sql = "SELECT {$page}_id AS id, {$page}_title AS oldtitle, $encNamespace + {$page}_namespace AS namespace, - $titleSql AS title + $titleSql AS title, + {$page}_namespace AS oldnamespace FROM {$table} WHERE ( {$page}_namespace=0 OR {$page}_namespace=1 ) AND {$page}_title " . $this->db->buildLike( $name . ':', $this->db->anyString() ); @@ -224,15 +225,17 @@ class NamespaceConflictChecker extends Maintenance { if( is_null($newTitle) || !$newTitle->canExist() ) { // Title is also an illegal title... // For the moment we'll let these slide to cleanupTitles or whoever. - $this->output( sprintf( "... %d (0,\"%s\")\n", + $this->output( sprintf( "... %d (%d,\"%s\")\n", $row->id, + $row->oldnamespace, $row->oldtitle ) ); $this->output( "... *** cannot resolve automatically; illegal title ***\n" ); return false; } - $this->output( sprintf( "... %d (0,\"%s\") -> (%d,\"%s\") [[%s]]\n", + $this->output( sprintf( "... %d (%d,\"%s\") -> (%d,\"%s\") [[%s]]\n", $row->id, + $row->oldnamespace, $row->oldtitle, $newTitle->getNamespace(), $newTitle->getDBkey(), @@ -291,8 +294,9 @@ class NamespaceConflictChecker extends Maintenance { "{$prefix}_title" => $newTitle->getDBkey(), ), array( - "{$prefix}_namespace" => 0, - "{$prefix}_title" => $row->oldtitle, + // "{$prefix}_namespace" => 0, + // "{$prefix}_title" => $row->oldtitle, + "{$prefix}_id" => $row->id, ), __METHOD__ ); $this->output( "ok.\n" ); -- 2.20.1