}
protected function doDBUpdates() {
+ $batchSize = $this->getBatchSize();
$db = $this->getDB( DB_MASTER );
if ( !$db->tableExists( 'revision' ) ) {
$this->error( "revision table does not exist" );
return false;
}
$this->output( "Populating rev_parent_id column\n" );
- $start = $db->selectField( 'revision', 'MIN(rev_id)', false, __FUNCTION__ );
- $end = $db->selectField( 'revision', 'MAX(rev_id)', false, __FUNCTION__ );
+ $start = $db->selectField( 'revision', 'MIN(rev_id)', '', __FUNCTION__ );
+ $end = $db->selectField( 'revision', 'MAX(rev_id)', '', __FUNCTION__ );
if ( is_null( $start ) || is_null( $end ) ) {
$this->output( "...revision table seems to be empty, nothing to do.\n" );
}
# Do remaining chunk
$blockStart = intval( $start );
- $blockEnd = intval( $start ) + $this->mBatchSize - 1;
+ $blockEnd = intval( $start ) + $batchSize - 1;
$count = 0;
$changed = 0;
while ( $blockStart <= $end ) {
__METHOD__ );
$count++;
}
- $blockStart += $this->mBatchSize;
- $blockEnd += $this->mBatchSize;
+ $blockStart += $batchSize;
+ $blockEnd += $batchSize;
wfWaitForSlaves();
}
$this->output( "rev_parent_id population complete ... {$count} rows [{$changed} changed]\n" );
}
}
-$maintClass = "PopulateParentId";
+$maintClass = PopulateParentId::class;
require_once RUN_MAINTENANCE_IF_MAIN;