Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Temporary fix contacts search
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen authored and blizzz committed Oct 14, 2020
commit d683026bda0aeeae4484a16c5227ff29d1bbd6a6
14 changes: 8 additions & 6 deletions apps/dav/lib/CardDAV/CardDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -929,12 +929,14 @@ public function search($addressBookId, $pattern, $searchProperties, $options = a
$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())));
Expand Down