diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-07-12 20:35:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-12 20:35:54 +0200 |
commit | e9ac0287f2b7d4da856bec416a282c8fc4c7feab (patch) | |
tree | b3cbc77a6c5f8357d9442f74a3273579088a3e00 /apps | |
parent | 4882e5c15a41754e912a9ef97a7e1570d26c7006 (diff) | |
parent | 9206c0f473e5d1b91345cfc78c050080d0d1b036 (diff) | |
download | nextcloud-server-e9ac0287f2b7d4da856bec416a282c8fc4c7feab.tar.gz nextcloud-server-e9ac0287f2b7d4da856bec416a282c8fc4c7feab.zip |
Merge pull request #39297 from nextcloud/fix/dav/close-cursor
fix(dav): close cursor when fetching max id
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 ef41301b840..a948c54ad58 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; } |