dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a72fa4c
)
Fix populateContentTables.php with no rows
author
Brad Jorsch
<bjorsch@wikimedia.org>
Wed, 11 Jul 2018 19:00:41 +0000
(15:00 -0400)
committer
Reedy
<reedy@wikimedia.org>
Thu, 12 Jul 2018 17:34:18 +0000
(17:34 +0000)
MIN() and MAX() return null if there are no rows. Fill in a dummy row in
that case.
Change-Id: I7caba98a5ec30e15e19d49effa22a70c78a71c28
maintenance/populateContentTables.php
patch
|
blob
|
history
diff --git
a/maintenance/populateContentTables.php
b/maintenance/populateContentTables.php
index
5322b5b
..
20d6b8b
100644
(file)
--- a/
maintenance/populateContentTables.php
+++ b/
maintenance/populateContentTables.php
@@
-188,6
+188,11
@@
class PopulateContentTables extends Maintenance {
'',
__METHOD__
);
+ 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 ) {