Only check unique keys for the comparison on filecache insert & update otherwise

This commit is contained in:
Joas Schilling 2015-03-09 18:20:51 +01:00 committed by Thomas Müller
parent 8fa692388b
commit c917ea183c
1 changed files with 6 additions and 1 deletions

View 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);
}
}