From d683026bda0aeeae4484a16c5227ff29d1bbd6a6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 29 Apr 2020 14:48:41 +0200 Subject: [PATCH] Temporary fix contacts search Signed-off-by: Joas Schilling --- apps/dav/lib/CardDAV/CardDavBackend.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 507e12cfc1b..03dbfc74957 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -929,12 +929,14 @@ class CardDavBackend implements BackendInterface, SyncSupport { $query2->andWhere($query2->expr()->ilike('cp.value', $query->createNamedParameter('%' . $this->db->escapeLikeParameter($pattern) . '%'))); } } - if (isset($options['limit'])) { - $query2->setMaxResults($options['limit']); - } - if (isset($options['offset'])) { - $query2->setFirstResult($options['offset']); - } +// // FIXME Broken on MySQL: SQLSTATE[42000]: Syntax error or access violation: 1235 This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery' +// // FIXME Should use 2 queries instead +// if (isset($options['limit'])) { +// $query2->setMaxResults($options['limit']); +// } +// if (isset($options['offset'])) { +// $query2->setFirstResult($options['offset']); +// } $query->select('c.carddata', 'c.uri')->from($this->dbCardsTable, 'c') ->where($query->expr()->in('c.id', $query->createFunction($query2->getSQL())));