diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-05-04 13:03:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-04 13:03:39 +0300 |
commit | 3cebf07d9dfd5d8c466cd1ace68c1b5794788d6f (patch) | |
tree | 4caf22782d2f9f75db97fd9c19bd93629889ce56 | |
parent | 2f435430548086efde61b639f4d43502782b012a (diff) | |
parent | d054cfc7b383f13e894c438aa4a26a993608b7db (diff) |
Merge pull request #1975 from nextcloud/backport/1974/stable24
[stable24] Fix MountProvider fetching paths on oracle
-rw-r--r-- | lib/Mount/MountProvider.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Mount/MountProvider.php b/lib/Mount/MountProvider.php index d9821803..3dc01adc 100644 --- a/lib/Mount/MountProvider.php +++ b/lib/Mount/MountProvider.php @@ -263,10 +263,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->executeQuery()->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); } |