r46752 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46751‎ | r46752 | r46753 >
Date:02:07, 3 February 2009
Author:tstarling
Status:ok
Tags:
Comment:
* Support for the "blobs table" LB config parameter
* Don't redefine the constructor
Modified paths:
  • /trunk/phase3/maintenance/storage/trackBlobs.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/storage/trackBlobs.php
@@ -11,7 +11,7 @@
1212 exit( 1 );
1313 }
1414 $tracker = new TrackBlobs( $args );
15 -$tracker->trackBlobs();
 15+$tracker->run();
1616
1717 class TrackBlobs {
1818 var $clusters, $textClause;
@@ -33,7 +33,7 @@
3434 }
3535 }
3636
37 - function trackBlobs() {
 37+ function run() {
3838 $this->initTrackingTable();
3939 $this->trackRevisions();
4040 $this->trackOrphanText();
@@ -259,14 +259,18 @@
260260 }
261261 continue;
262262 }
 263+ $table = $extDB->getLBInfo( 'blobs table' );
 264+ if ( is_null( $table ) ) {
 265+ $table = 'blobs';
 266+ }
263267 $startId = 0;
264268 $batchesDone = 0;
265269 $actualBlobs = gmp_init( 0 );
266 - $endId = $extDB->selectField( 'blobs', 'MAX(blob_id)', false, __METHOD__ );
 270+ $endId = $extDB->selectField( $table, 'MAX(blob_id)', false, __METHOD__ );
267271
268272 // Build a bitmap of actual blob rows
269273 while ( true ) {
270 - $res = $extDB->select( 'blobs',
 274+ $res = $extDB->select( $table,
271275 array( 'blob_id' ),
272276 array( 'blob_id > ' . $extDB->addQuotes( $startId ) ),
273277 __METHOD__,

Status & tagging log