Temporary fix contacts search

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-04-29 14:48:41 +02:00
parent b219eadb8f
commit f662d3663b
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 8 additions and 6 deletions

View File

@ -966,12 +966,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())));