https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113965
Revision: 113965
Author: reedy
Date: 2012-03-15 22:15:44 +0000 (Thu, 15 Mar 2012)
Log Message:
-----------
MFT r113964
Modified Paths:
--------------
branches/wmf/1.19wmf1/extensions/WikimediaMaintenance/cleanupBug31576.php
Property Changed:
----------------
branches/wmf/1.19wmf1/extensions/
branches/wmf/1.19wmf1/extensions/WikimediaMaintenance/
Property changes on: branches/wmf/1.19wmf1/extensions
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/JSTesting/extensions:100352-107913
/branches/REL1_15/phase3/extensions:51646
/branches/REL1_17/phase3/extensions:81445,81448
/branches/new-installer/phase3/extensions:43664-66004
/branches/sqlite/extensions:58211-58321
/branches/wmf/1.18wmf1/extensions:97508
/trunk/extensions:110933,111011,111043,111199,111218,111484,111575,111604,111659-111661,111668,111670,111688,111690,111698,111713,111715,111780,111796,111814,111947,112074,112153,112160,112166,112260,112282,112360,112517,112571,112586,112613,112628,112751,112758,112770-112772,112775,112849,112851,112856,112859,112903,112925,112930,112993,113352,113367,113458,113926,113948
/trunk/phase3/extensions:111002,111029,111034,111062,111067,111076,111085,111128,111144,111251
+ /branches/JSTesting/extensions:100352-107913
/branches/REL1_15/phase3/extensions:51646
/branches/REL1_17/phase3/extensions:81445,81448
/branches/new-installer/phase3/extensions:43664-66004
/branches/sqlite/extensions:58211-58321
/branches/wmf/1.18wmf1/extensions:97508
/trunk/extensions:110933,111011,111043,111199,111218,111484,111575,111604,111659-111661,111668,111670,111688,111690,111698,111713,111715,111780,111796,111814,111947,112074,112153,112160,112166,112260,112282,112360,112517,112571,112586,112613,112628,112751,112758,112770-112772,112775,112849,112851,112856,112859,112903,112925,112930,112993,113352,113367,113458,113926,113948,113964
/trunk/phase3/extensions:111002,111029,111034,111062,111067,111076,111085,111128,111144,111251
Property changes on: branches/wmf/1.19wmf1/extensions/WikimediaMaintenance
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/wmf/1.18wmf1/maintenance:106284,109759
/trunk/extensions/WikimediaMaintenance:113928,113948
+ /branches/wmf/1.18wmf1/maintenance:106284,109759
/trunk/extensions/WikimediaMaintenance:113928,113948,113964
Modified:
branches/wmf/1.19wmf1/extensions/WikimediaMaintenance/cleanupBug31576.php
===================================================================
--- branches/wmf/1.19wmf1/extensions/WikimediaMaintenance/cleanupBug31576.php
2012-03-15 22:09:55 UTC (rev 113964)
+++ branches/wmf/1.19wmf1/extensions/WikimediaMaintenance/cleanupBug31576.php
2012-03-15 22:15:44 UTC (rev 113965)
@@ -30,12 +30,19 @@
$pCount = 0;
$vCount = 0;
$this->output( "Fixing pages with template links to $synonym
...\n" );
+ $from = null;
while ( true ) {
+ $where = array(
+ 'tl_namespace' => NS_TEMPLATE,
+ 'tl_title ' . $dbr->buildLike( $synonym,
$dbr->anyString() )
+ );
+ if ( $from !== null ) {
+ $where[] = 'tl_from > ' . $dbr->addQuotes(
$from );
+ $from = null;
+ }
$res = $dbr->select( 'templatelinks', array(
'tl_title', 'tl_from' ),
- array(
- 'tl_namespace' => NS_TEMPLATE,
- 'tl_title' => $synonym
- ), __METHOD__,
+ $where,
+ __METHOD__,
array( 'ORDER BY' => array( 'tl_title',
'tl_from' ), 'LIMIT' => $this->batchsize )
);
if ( $dbr->numRows( $res ) == 0 ) {
@@ -53,6 +60,9 @@
$this->processed[$row->tl_from] = true;
$pCount++;
}
+ if ( isset( $row ) ) {
+ $from = $row->tl_from;
+ }
$this->output( "{$pCount}/{$vCount} pages processed\n"
);
wfWaitForSlaves();
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs