From: Roland Hager Date: Thu, 16 May 2013 15:18:07 +0000 (+0200) Subject: Fixing UPDATE error in filecache table when renaming files by calling move(). Add... X-Git-Tag: v6.0.0alpha2~734^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2ea2abf11e31904db187dfe9975cc34247fde1d7;p=nextcloud-server.git Fixing UPDATE error in filecache table when renaming files by calling move(). Add storage id to the where clause to avoid updating entries of other users. --- diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php index 0617471079b..0e7a96aaca8 100644 --- a/lib/files/cache/cache.php +++ b/lib/files/cache/cache.php @@ -335,8 +335,8 @@ class Cache { if ($sourceData['mimetype'] === 'httpd/unix-directory') { //find all child entries - $query = \OC_DB::prepare('SELECT `path`, `fileid` FROM `*PREFIX*filecache` WHERE `path` LIKE ?'); - $result = $query->execute(array($source . '/%')); + $query = \OC_DB::prepare('SELECT `path`, `fileid` FROM `*PREFIX*filecache` WHERE `storage` = ? AND `path` LIKE ?'); + $result = $query->execute(array($this->getNumericStorageId(), $source . '/%')); $childEntries = $result->fetchAll(); $sourceLength = strlen($source); $query = \OC_DB::prepare('UPDATE `*PREFIX*filecache` SET `path` = ?, `path_hash` = ? WHERE `fileid` = ?');