From 6361edb8641cc38bac66f1cd19f9b1b58621c9ea Mon Sep 17 00:00:00 2001 From: Hamza Mahjoubi Date: Tue, 27 Aug 2024 14:07:28 +0200 Subject: [PATCH] fix: optimise getWrongShareOwnership query Signed-off-by: Hamza Mahjoubi --- core/Command/Maintenance/RepairShareOwnership.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/Command/Maintenance/RepairShareOwnership.php b/core/Command/Maintenance/RepairShareOwnership.php index 71bc50b0bb888..a24be53b00ef4 100644 --- a/core/Command/Maintenance/RepairShareOwnership.php +++ b/core/Command/Maintenance/RepairShareOwnership.php @@ -85,7 +85,7 @@ protected function getWrongShareOwnership(): array { $brokenShares = $qb ->select('s.id', 'm.user_id', 's.uid_owner', 's.uid_initiator', 's.share_with', 's.file_target') ->from('share', 's') - ->join('s', 'filecache', 'f', $qb->expr()->eq('s.item_source', $qb->expr()->castColumn('f.fileid', IQueryBuilder::PARAM_STR))) + ->join('s', 'filecache', 'f', $qb->expr()->eq($qb->expr()->castColumn('s.item_source', IQueryBuilder::PARAM_INT), 'f.fileid')) ->join('s', 'mounts', 'm', $qb->expr()->eq('f.storage', 'm.storage_id')) ->where($qb->expr()->neq('m.user_id', 's.uid_owner')) ->andWhere($qb->expr()->eq($qb->func()->concat($qb->expr()->literal('/'), 'm.user_id', $qb->expr()->literal('/')), 'm.mount_point'))