mirror of
https://github.com/nextcloud/server.git
synced 2026-03-04 22:41:13 -05:00
Merge pull request #39297 from nextcloud/fix/dav/close-cursor
fix(dav): close cursor when fetching max id
This commit is contained in:
commit
e9ac0287f2
2 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue