Fix getPathById for Oracle

Added extra code to handle the case of Oracle which saves empty strings
as null values.
This commit is contained in:
Vincent Petry 2014-05-08 13:33:55 +02:00
parent f73a168694
commit 05dc694c5c
1 changed files with 4 additions and 0 deletions

View File

@ -603,6 +603,10 @@ class Cache {
$sql = 'SELECT `path` FROM `*PREFIX*filecache` WHERE `fileid` = ? AND `storage` = ?'; $sql = 'SELECT `path` FROM `*PREFIX*filecache` WHERE `fileid` = ? AND `storage` = ?';
$result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId())); $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId()));
if ($row = $result->fetchRow()) { if ($row = $result->fetchRow()) {
// Oracle stores empty strings as null...
if ($row['path'] === null) {
return '';
}
return $row['path']; return $row['path'];
} else { } else {
return null; return null;