]> source.dussan.org Git - nextcloud-server.git/commitdiff
Only check unique keys for the comparison on filecache insert & update otherwise
authorJoas Schilling <nickvergessen@owncloud.com>
Mon, 9 Mar 2015 17:20:51 +0000 (18:20 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Mon, 9 Mar 2015 21:37:49 +0000 (22:37 +0100)
lib/private/files/cache/cache.php

index 62c32ce65932f9117bdae8d6f485c18c616cb9d2..d39b59b23e4a2fea525bed613c7b49dded5a9378 100644 (file)
@@ -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);
                }
        }