From f5471f308e8df03014e3570867b4cdba9afa732e Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Wed, 27 Apr 2022 12:00:30 +0200 Subject: Fix MountProvider fetching paths on orache Signed-off-by: Carl Schwan --- lib/Mount/MountProvider.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/Mount/MountProvider.php b/lib/Mount/MountProvider.php index fb5a82f8..4aa88c37 100644 --- a/lib/Mount/MountProvider.php +++ b/lib/Mount/MountProvider.php @@ -244,10 +244,15 @@ class MountProvider implements IMountProvider { $query->select('path') ->from('filecache') ->where($query->expr()->eq('storage', $query->createNamedParameter($userHome->getNumericStorageId(), IQueryBuilder::PARAM_INT))) - ->andWhere($query->expr()->in('path_hash', $query->createNamedParameter($pathHashes, IQueryBuilder::PARAM_STR_ARRAY))); + ->andWhere($query->expr()->in('path_hash', $query->createParameter('chunk'))); - $paths = $query->execute()->fetchAll(\PDO::FETCH_COLUMN); - return array_map(function($path) { + $paths = []; + foreach (array_chunk($pathHashes, 1000) as $chunk) { + $query->setParameter('chunk', $chunk, IQueryBuilder::PARAM_STR_ARRAY); + $paths = array_merge($paths, $query->executeQuery()->fetchAll(\PDO::FETCH_COLUMN)); + } + + return array_map(function (string $path): string { return substr($path, 6); // strip leading "files/" }, $paths); } -- cgit v1.2.3