]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix: optimise getWrongShareOwnership query 47525/head
authorHamza Mahjoubi <hamzamahjoubi221@gmail.com>
Tue, 27 Aug 2024 12:07:28 +0000 (14:07 +0200)
committerHamza Mahjoubi <hamzamahjoubi221@gmail.com>
Tue, 27 Aug 2024 12:08:29 +0000 (14:08 +0200)
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
core/Command/Maintenance/RepairShareOwnership.php

index 71bc50b0bb888a31af6afa7893997a133e795556..a24be53b00ef4bc4153ebf381420c7ee3baeea79 100644 (file)
@@ -85,7 +85,7 @@ class RepairShareOwnership extends Command {
                $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'))