Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/groupfolders.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-04-27 13:00:30 +0300
committerCarl Schwan <carl@carlschwan.eu>2022-04-27 14:59:48 +0300
commitf5471f308e8df03014e3570867b4cdba9afa732e (patch)
tree8f4fc8701b20ab93136749ceef694d072d506166
parent054f38f8b87870bd0c8462971329caf92831530e (diff)
Fix MountProvider fetching paths on orachebackport/1974/stable22
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
-rw-r--r--lib/Mount/MountProvider.php11
1 files 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);
}