Ensure that the post update doesn't end prematurely (#5684)

This commit is contained in:
Michael Vogel 2018-08-28 11:56:25 +00:00 committed by Hypolite Petovan
parent 27cf228857
commit cf6140e86f

View file

@ -253,6 +253,12 @@ class PostUpdate
$condition = ["`id` > ?", $id]; $condition = ["`id` > ?", $id];
$params = ['order' => ['id'], 'limit' => 10000]; $params = ['order' => ['id'], 'limit' => 10000];
$items = Item::select($fields, $condition, $params); $items = Item::select($fields, $condition, $params);
if (DBA::errorNo() != 0) {
logger('Database error ' . DBA::errorNo() . ':' . DBA::errorMessage());
return false;
}
while ($item = Item::fetch($items)) { while ($item = Item::fetch($items)) {
$id = $item['id']; $id = $item['id'];
@ -394,6 +400,12 @@ class PostUpdate
$condition = ["`id` > ?", $id]; $condition = ["`id` > ?", $id];
$params = ['order' => ['id'], 'limit' => 10000]; $params = ['order' => ['id'], 'limit' => 10000];
$items = DBA::select('item', $fields, $condition, $params); $items = DBA::select('item', $fields, $condition, $params);
if (DBA::errorNo() != 0) {
logger('Database error ' . DBA::errorNo() . ':' . DBA::errorMessage());
return false;
}
while ($item = DBA::fetch($items)) { while ($item = DBA::fetch($items)) {
$id = $item['id']; $id = $item['id'];