diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2022-03-11 16:59:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-11 16:59:37 +0100 |
commit | 5ad55fad359fec5d5d7e7761f1af7f266b8c246c (patch) | |
tree | a63514919703ec76c89c2f8d656a8b993a7e991c /apps/dav/lib | |
parent | bcb1fc5a81231a0610c180212648f47eeb69e957 (diff) | |
parent | 2cdaa28accbdca6f410421249055a79aba6fe8e5 (diff) | |
download | nextcloud-server-5ad55fad359fec5d5d7e7761f1af7f266b8c246c.tar.gz nextcloud-server-5ad55fad359fec5d5d7e7761f1af7f266b8c246c.zip |
Merge pull request #31274 from nextcloud/fix/carddav-backend-1000-orache1
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/CardDAV/CardDavBackend.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 3e360fb2e41..1c1754ff752 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -139,7 +139,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { ->from('addressbooks') ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri))); - $result = $query->execute(); + $result = $query->executeQuery(); $column = (int) $result->fetchOne(); $result->closeCursor(); return $column; @@ -1130,15 +1130,18 @@ class CardDavBackend implements BackendInterface, SyncSupport { return (int)$match['cardid']; }, $matches); + $cards = []; $query = $this->db->getQueryBuilder(); $query->select('c.addressbookid', 'c.carddata', 'c.uri') ->from($this->dbCardsTable, 'c') - ->where($query->expr()->in('c.id', $query->createNamedParameter($matches, IQueryBuilder::PARAM_INT_ARRAY))); - - $result = $query->execute(); - $cards = $result->fetchAll(); + ->where($query->expr()->in('c.id', $query->createParameter('matches'))); - $result->closeCursor(); + foreach (array_chunk($matches, 1000) as $matchesChunk) { + $query->setParameter('matches', $matchesChunk, IQueryBuilder::PARAM_INT_ARRAY); + $result = $query->executeQuery(); + $cards = array_merge($cards, $result->fetchAll()); + $result->closeCursor(); + } return array_map(function ($array) { $array['addressbookid'] = (int) $array['addressbookid']; |