diff options
author | Robin Appelman <robin@icewind.nl> | 2024-07-04 19:21:03 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-07-17 15:46:21 +0200 |
commit | 5ff7bde3fb1213cb0141d2e33fdc762298103116 (patch) | |
tree | b004a1eb8858b91d99959a843d712e435685c4ec | |
parent | 19ba872e9aae98686ad61acd543f9945d8577797 (diff) | |
download | nextcloud-server-5ff7bde3fb1213cb0141d2e33fdc762298103116.tar.gz nextcloud-server-5ff7bde3fb1213cb0141d2e33fdc762298103116.zip |
fix: add set storage id for more cache queries
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index c132ac1f034..940b192e735 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -199,6 +199,7 @@ class Cache implements ICache { $query = $this->getQueryBuilder(); $query->selectFileCache() ->whereParent($fileId) + ->whereStorageId($this->getNumericStorageId()) ->orderBy('name', 'ASC'); $metadataQuery = $query->selectMetadata(); @@ -337,6 +338,7 @@ class Cache implements ICache { $query->update('filecache') ->whereFileId($id) + ->whereStorageId($this->getNumericStorageId()) ->andWhere($query->expr()->orX(...array_map(function ($key, $value) use ($query) { return $query->expr()->orX( $query->expr()->neq($key, $query->createNamedParameter($value)), @@ -512,6 +514,7 @@ class Cache implements ICache { if ($entry instanceof ICacheEntry) { $query = $this->getQueryBuilder(); $query->delete('filecache') + ->whereStorageId($this->getNumericStorageId()) ->whereFileId($entry->getId()); $query->execute(); @@ -583,6 +586,7 @@ class Cache implements ICache { $query = $this->getQueryBuilder(); $query->delete('filecache') + ->whereStorageId($this->getNumericStorageId()) ->whereParentInParameter('parentIds'); // Sorting before chunking allows the db to find the entries close to each @@ -929,6 +933,7 @@ class Cache implements ICache { $query = $this->getQueryBuilder(); $query->select('size', 'unencrypted_size') ->from('filecache') + ->whereStorageId($this->getNumericStorageId()) ->whereParent($id); if ($ignoreUnknown) { $query->andWhere($query->expr()->gte('size', $query->createNamedParameter(0))); |