$revisionTable = $dbw->tableName( 'revision' );
$res = $dbw->query( "SELECT MIN(rev_id) as minrev, MAX(rev_id) as maxrev FROM $revisionTable " .
"WHERE rev_timestamp BETWEEN '{$start}' AND '{$end}'", __METHOD__ );
$row = $dbw->fetchObject( $res );
if ( is_null( $row->minrev ) ) {
$revisionTable = $dbw->tableName( 'revision' );
$res = $dbw->query( "SELECT MIN(rev_id) as minrev, MAX(rev_id) as maxrev FROM $revisionTable " .
"WHERE rev_timestamp BETWEEN '{$start}' AND '{$end}'", __METHOD__ );
$row = $dbw->fetchObject( $res );
if ( is_null( $row->minrev ) ) {