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:
parent
f73a168694
commit
05dc694c5c
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue