[Pkg-owncloud-commits] [owncloud] 46/118: Only check unique keys for the comparison on filecache insert & update otherwise

David Prévot taffit at moszumanska.debian.org
Fri Mar 27 22:13:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 78b2c8b0be29be11929d04da80235fff0fe85751
Author: Joas Schilling <nickvergessen at owncloud.com>
Date:   Mon Mar 9 18:20:51 2015 +0100

    Only check unique keys for the comparison on filecache insert & update otherwise
---
 lib/private/files/cache/cache.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php
index 56c9bfa..1e9df6e 100644
--- a/lib/private/files/cache/cache.php
+++ b/lib/private/files/cache/cache.php
@@ -248,10 +248,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);
 		}
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list