Skip to content

Commit

Permalink
fixup! chunking in statements
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Larch <anna@nextcloud.com>
  • Loading branch information
miaulalala committed May 18, 2021
1 parent e73a935 commit de88d52
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Db/MessageMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,7 @@ public function findRelatedData(array $messages, string $userId): array {

/**
* @param Mailbox $mailbox
* @param int $highest
*
* @param array $ids
* @return int[]
*/
public function findNewIds(Mailbox $mailbox, array $ids): array {
Expand All @@ -974,7 +973,7 @@ public function findNewIds(Mailbox $mailbox, array $ids): array {

return array_flat_map(function (array $chunk) use ($qb, $subSelect) {
$qb->setParameter('ids', $chunk, IQueryBuilder::PARAM_INT_ARRAY);
$select = $qb->where(
$select = $qb->andWhere(
$qb->expr()->gt('uid', $qb->createFunction('(' . $subSelect->getSQL() . ')'), IQueryBuilder::PARAM_INT)
);
return $this->findIds($select);
Expand Down

0 comments on commit de88d52

Please sign in to comment.