From: Joas Schilling Date: Mon, 9 Mar 2015 17:20:51 +0000 (+0100) Subject: Only check unique keys for the comparison on filecache insert & update otherwise X-Git-Tag: v8.1.0alpha1~280^2~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c917ea183ce0acf7c49f8c7104c9ffa54f2b804f;p=nextcloud-server.git Only check unique keys for the comparison on filecache insert & update otherwise --- diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index 62c32ce6593..d39b59b23e4 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -251,10 +251,15 @@ class Cache { return trim($item, "`"); }, $queryParts); $values = array_combine($queryParts, $params); - if (\OC::$server->getDatabaseConnection()->insertIfNotExist('*PREFIX*filecache', $values)) { + if (\OC::$server->getDatabaseConnection()->insertIfNotExist('*PREFIX*filecache', $values, [ + 'storage', + 'path_hash', + ])) { return (int)\OC_DB::insertid('*PREFIX*filecache'); } + // The file was created in the mean time + $this->update($id, $data); return $this->getId($file); } }