r113965 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113964‎ | r113965 | r113966 >
Date:22:15, 15 March 2012
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.19wmf1/extensions (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/WikimediaMaintenance (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/WikimediaMaintenance/cleanupBug31576.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/extensions/WikimediaMaintenance/cleanupBug31576.php
@@ -30,12 +30,19 @@
3131 $pCount = 0;
3232 $vCount = 0;
3333 $this->output( "Fixing pages with template links to $synonym ...\n" );
 34+ $from = null;
3435 while ( true ) {
 36+ $where = array(
 37+ 'tl_namespace' => NS_TEMPLATE,
 38+ 'tl_title ' . $dbr->buildLike( $synonym, $dbr->anyString() )
 39+ );
 40+ if ( $from !== null ) {
 41+ $where[] = 'tl_from > ' . $dbr->addQuotes( $from );
 42+ $from = null;
 43+ }
3544 $res = $dbr->select( 'templatelinks', array( 'tl_title', 'tl_from' ),
36 - array(
37 - 'tl_namespace' => NS_TEMPLATE,
38 - 'tl_title' => $synonym
39 - ), __METHOD__,
 45+ $where,
 46+ __METHOD__,
4047 array( 'ORDER BY' => array( 'tl_title', 'tl_from' ), 'LIMIT' => $this->batchsize )
4148 );
4249 if ( $dbr->numRows( $res ) == 0 ) {
@@ -53,6 +60,9 @@
5461 $this->processed[$row->tl_from] = true;
5562 $pCount++;
5663 }
 64+ if ( isset( $row ) ) {
 65+ $from = $row->tl_from;
 66+ }
5767 $this->output( "{$pCount}/{$vCount} pages processed\n" );
5868 wfWaitForSlaves();
5969 }
Property changes on: branches/wmf/1.19wmf1/extensions/WikimediaMaintenance
___________________________________________________________________
Modified: svn:mergeinfo
6070 Merged /trunk/extensions/WikimediaMaintenance:r113964
Property changes on: branches/wmf/1.19wmf1/extensions
___________________________________________________________________
Modified: svn:mergeinfo
6171 Merged /trunk/extensions:r113964

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113964Just because we pull a result from the database, doesn't mean it needs fixing...reedy22:09, 15 March 2012

Status & tagging log