Avoid extra parenthesis around SQL in IN expressions

The expression builder already suround the SQL with parenthesis when
 using in(), so we must not add another pair, this confuses at least
 sqlite.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/36795/head
Côme Chilliet 1 year ago committed by Côme Chilliet (Rebase PR Action)
parent 5fcb55a2a9
commit 74811813e7

@ -660,7 +660,7 @@ class Manager {
$query->delete('federated_reshares')
->where($query->expr()->in('share_id', $query->createFunction('(' . $select . ')')));
->where($query->expr()->in('share_id', $query->createFunction($select)));
$query->execute();
$deleteReShares = $this->connection->getQueryBuilder();
@ -730,10 +730,10 @@ class Manager {
// delete group share entry and matching sub-entries
$qb->delete('share_external')
->where(
$qb->expr()->orX(
$qb->expr()->eq('id', $qb->createParameter('share_id')),
$qb->expr()->eq('parent', $qb->createParameter('share_parent_id'))
)
$qb->expr()->orX(
$qb->expr()->eq('id', $qb->createParameter('share_id')),
$qb->expr()->eq('parent', $qb->createParameter('share_parent_id'))
)
);
foreach ($shares as $share) {

@ -126,7 +126,7 @@ class RemoveLinkShares implements IRepairStep {
$query = $this->connection->getQueryBuilder();
$query->select($query->func()->count('*', 'total'))
->from('share')
->where($query->expr()->in('id', $query->createFunction('(' . $subQuery->getSQL() . ')')));
->where($query->expr()->in('id', $query->createFunction($subQuery->getSQL())));
$result = $query->execute();
$data = $result->fetch();

Loading…
Cancel
Save