r66624 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66623‎ | r66624 | r66625 >
Date:20:35, 18 May 2010
Author:jeluf
Status:ok
Tags:
Comment:
Use ID instead of (namespace,title) for the update statement, fix reporting
Modified paths:
  • /trunk/phase3/maintenance/namespaceDupes.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/namespaceDupes.php
@@ -200,7 +200,8 @@
201201 $sql = "SELECT {$page}_id AS id,
202202 {$page}_title AS oldtitle,
203203 $encNamespace + {$page}_namespace AS namespace,
204 - $titleSql AS title
 204+ $titleSql AS title,
 205+ {$page}_namespace AS oldnamespace
205206 FROM {$table}
206207 WHERE ( {$page}_namespace=0 OR {$page}_namespace=1 )
207208 AND {$page}_title " . $this->db->buildLike( $name . ':', $this->db->anyString() );
@@ -224,15 +225,17 @@
225226 if( is_null($newTitle) || !$newTitle->canExist() ) {
226227 // Title is also an illegal title...
227228 // For the moment we'll let these slide to cleanupTitles or whoever.
228 - $this->output( sprintf( "... %d (0,\"%s\")\n",
 229+ $this->output( sprintf( "... %d (%d,\"%s\")\n",
229230 $row->id,
 231+ $row->oldnamespace,
230232 $row->oldtitle ) );
231233 $this->output( "... *** cannot resolve automatically; illegal title ***\n" );
232234 return false;
233235 }
234236
235 - $this->output( sprintf( "... %d (0,\"%s\") -> (%d,\"%s\") [[%s]]\n",
 237+ $this->output( sprintf( "... %d (%d,\"%s\") -> (%d,\"%s\") [[%s]]\n",
236238 $row->id,
 239+ $row->oldnamespace,
237240 $row->oldtitle,
238241 $newTitle->getNamespace(),
239242 $newTitle->getDBkey(),
@@ -291,8 +294,9 @@
292295 "{$prefix}_title" => $newTitle->getDBkey(),
293296 ),
294297 array(
295 - "{$prefix}_namespace" => 0,
296 - "{$prefix}_title" => $row->oldtitle,
 298+ // "{$prefix}_namespace" => 0,
 299+ // "{$prefix}_title" => $row->oldtitle,
 300+ "{$prefix}_id" => $row->id,
297301 ),
298302 __METHOD__ );
299303 $this->output( "ok.\n" );

Status & tagging log