]> git.mxchange.org Git - friendica.git/commitdiff
Ensure that the post update doesn't end prematurely (#5684)
authorMichael Vogel <icarus@dabo.de>
Tue, 28 Aug 2018 11:56:25 +0000 (11:56 +0000)
committerHypolite Petovan <mrpetovan@eml.cc>
Tue, 28 Aug 2018 11:56:25 +0000 (07:56 -0400)
src/Database/PostUpdate.php

index 09e940b149d1ae9f45e92b4bd9e12b49aba11327..674fe05531c6d128f69c75fb80c42bd70d36d12b 100644 (file)
@@ -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'];