MIN() and MAX() return null if there are no rows. Fill in a dummy row in
that case.
Change-Id: I7caba98a5ec30e15e19d49effa22a70c78a71c28
+ if ( !$minmax || !is_numeric( $minmax->min ) || !is_numeric( $minmax->max ) ) {
+ // No rows?
+ $minmax = (object)[ 'min' => 1, 'max' => 0 ];
+ }
+
$batchSize = $this->getBatchSize();
for ( $startId = $minmax->min; $startId <= $minmax->max; $startId += $batchSize ) {
$batchSize = $this->getBatchSize();
for ( $startId = $minmax->min; $startId <= $minmax->max; $startId += $batchSize ) {