diff options
author | Richard Steinmetz <richard@steinmetz.cloud> | 2023-07-11 07:58:16 +0200 |
---|---|---|
committer | Richard Steinmetz <richard@steinmetz.cloud> | 2023-07-11 08:05:34 +0200 |
commit | 9206c0f473e5d1b91345cfc78c050080d0d1b036 (patch) | |
tree | 61a73f9c92a021bdfe6b61e1c2198fb1a1e58d3d /apps | |
parent | 428153c8ba79ec34828f9cb2ba1d2a3d89a6d8a3 (diff) | |
download | nextcloud-server-9206c0f473e5d1b91345cfc78c050080d0d1b036.tar.gz nextcloud-server-9206c0f473e5d1b91345cfc78c050080d0d1b036.zip |
fix(dav): close cursor when fetching max id
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/lib/CalDAV/CalDavBackend.php | 4 | ||||
-rw-r--r-- | apps/dav/lib/CardDAV/CardDavBackend.php | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index c57d3a2764f..1d526d89e6b 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -3139,7 +3139,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; } diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 1be1ce3f18f..045ad4d1385 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -1404,7 +1404,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; } |