From: Michael Vogel Date: Tue, 28 Aug 2018 11:56:25 +0000 (+0000) Subject: Ensure that the post update doesn't end prematurely (#5684) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cf6140e86f64c651168c7687179adc7114770f40;p=friendica.git Ensure that the post update doesn't end prematurely (#5684) --- diff --git a/src/Database/PostUpdate.php b/src/Database/PostUpdate.php index 09e940b149..674fe05531 100644 --- a/src/Database/PostUpdate.php +++ b/src/Database/PostUpdate.php @@ -253,6 +253,12 @@ class PostUpdate $condition = ["`id` > ?", $id]; $params = ['order' => ['id'], 'limit' => 10000]; $items = Item::select($fields, $condition, $params); + + if (DBA::errorNo() != 0) { + logger('Database error ' . DBA::errorNo() . ':' . DBA::errorMessage()); + return false; + } + while ($item = Item::fetch($items)) { $id = $item['id']; @@ -394,6 +400,12 @@ class PostUpdate $condition = ["`id` > ?", $id]; $params = ['order' => ['id'], 'limit' => 10000]; $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)) { $id = $item['id'];