]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(dav): close cursor when fetching max id 38920/head
authorRichard Steinmetz <richard@steinmetz.cloud>
Tue, 11 Jul 2023 05:58:16 +0000 (07:58 +0200)
committerRichard Steinmetz <richard@steinmetz.cloud>
Tue, 11 Jul 2023 05:58:46 +0000 (07:58 +0200)
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
apps/dav/lib/CalDAV/CalDavBackend.php
apps/dav/lib/CardDAV/CardDavBackend.php

index d11453afd62c1338eea90621d6727d4a2e788c15..d0faf40106db43ad9a9b2ffbe8f27ad78cbbcd7f 100644 (file)
@@ -3097,7 +3097,9 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
                $query->select($query->func()->max('id'))
                        ->from('calendarchanges');
 
-               $maxId =  $query->executeQuery()->fetchOne();
+               $result = $query->executeQuery();
+               $maxId = (int) $result->fetchOne();
+               $result->closeCursor();
                if (!$maxId || $maxId < $keep) {
                    return 0;
                }
index b6a246520168c4326aab18e40d5388584968bb6f..f4e8243cb2f89c7afb4106ac59e0afc2af7c1c46 100644 (file)
@@ -1328,7 +1328,9 @@ class CardDavBackend implements BackendInterface, SyncSupport {
                $query->select($query->func()->max('id'))
                        ->from('addressbookchanges');
 
-               $maxId =  $query->executeQuery()->fetchOne();
+               $result = $query->executeQuery();
+               $maxId = (int) $result->fetchOne();
+               $result->closeCursor();
                if (!$maxId || $maxId < $keep) {
                    return 0;
                }