$db = $this->getDB( DB_MASTER );
if ( !$db->tableExists( 'revision' ) ) {
- $this->error( "revision table does not exist", true );
+ $this->fatalError( "revision table does not exist" );
} elseif ( !$db->tableExists( 'archive' ) ) {
- $this->error( "archive table does not exist", true );
+ $this->fatalError( "archive table does not exist" );
} elseif ( !$db->fieldExists( 'revision', 'rev_sha1', __METHOD__ ) ) {
$this->output( "rev_sha1 column does not exist\n\n", true );
$blockEnd = $start + $batchSize - 1;
while ( $blockEnd <= $end ) {
$this->output( "...doing $idCol from $blockStart to $blockEnd\n" );
- $cond = "$idCol BETWEEN $blockStart AND $blockEnd
- AND $idCol IS NOT NULL AND {$prefix}_sha1 = ''";
+ $cond = "$idCol BETWEEN " . (int)$blockStart . " AND " . (int)$blockEnd .
+ " AND $idCol IS NOT NULL AND {$prefix}_sha1 = ''";
$res = $db->select(
$queryInfo['tables'], $queryInfo['fields'], $cond, __METHOD__, [], $queryInfo['joins']
);