Skip to content
Snippets Groups Projects
Commit 25381ac5 authored by Robin Appelman's avatar Robin Appelman
Browse files

fix filecache with MDB2

parent 398fbe7b
Branches
No related tags found
No related merge requests found
...@@ -303,8 +303,8 @@ class OC_FileCache{ ...@@ -303,8 +303,8 @@ class OC_FileCache{
if(self::inCache($path,$root)){ if(self::inCache($path,$root)){
$parent=self::getFileId($fullPath); $parent=self::getFileId($fullPath);
$query=OC_DB::prepare('SELECT size FROM *PREFIX*fscache WHERE parent=?'); $query=OC_DB::prepare('SELECT size FROM *PREFIX*fscache WHERE parent=?');
$query->execute(array($parent)); $result=$query->execute(array($parent));
while($row=$query->fetchRow()){ while($row=$result->fetchRow()){
$size+=$row['size']; $size+=$row['size'];
} }
$mtime=$view->filemtime($path); $mtime=$view->filemtime($path);
...@@ -330,8 +330,8 @@ class OC_FileCache{ ...@@ -330,8 +330,8 @@ class OC_FileCache{
} }
} }
$query=OC_DB::prepare('SELECT size FROM *PREFIX*fscache WHERE path=?'); $query=OC_DB::prepare('SELECT size FROM *PREFIX*fscache WHERE path=?');
$query->execute(array($path)); $result=$query->execute(array($path));
if($row=$query->fetchRow()){ if($row=$result->fetchRow()){
return $row['size']; return $row['size'];
}else{//file not in cache }else{//file not in cache
return 0; return 0;
...@@ -517,8 +517,8 @@ class OC_FileCache{ ...@@ -517,8 +517,8 @@ class OC_FileCache{
$isDir=$view->is_dir($path); $isDir=$view->is_dir($path);
$path=$root.$path; $path=$root.$path;
$query=OC_DB::prepare('SELECT mtime FROM *PREFIX*fscache WHERE path=?'); $query=OC_DB::prepare('SELECT mtime FROM *PREFIX*fscache WHERE path=?');
$query->execute(array($path)); $result=$query->execute(array($path));
if($row=$query->fetchRow()){ if($row=$result->fetchRow()){
$cachedMTime=$row['mtime']; $cachedMTime=$row['mtime'];
return ($mtime>$cachedMTime); return ($mtime>$cachedMTime);
}else{//file not in cache, so it has to be updated }else{//file not in cache, so it has to be updated
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment