From ca675d7b085f2c13a51dcd7bdbf05f8f1e20921d Mon Sep 17 00:00:00 2001 From: ringmaster Date: Thu, 14 Nov 2013 09:41:55 -0500 Subject: [PATCH 1/2] Alias the aggregate columns so SQL Server doesn't combine them. --- lib/private/files/cache/cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/files/cache/cache.php b/lib/private/files/cache/cache.php index 8c34fa5854..ac50a988e3 100644 --- a/lib/private/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -507,7 +507,7 @@ class Cache { $entry = $this->get($path); if ($entry && $entry['mimetype'] === 'httpd/unix-directory') { $id = $entry['fileid']; - $sql = 'SELECT SUM(`size`), MIN(`size`) FROM `*PREFIX*filecache` '. + $sql = 'SELECT SUM(`size`) AS f1, MIN(`size`) AS f2 FROM `*PREFIX*filecache` '. 'WHERE `parent` = ? AND `storage` = ?'; $result = \OC_DB::executeAudited($sql, array($id, $this->getNumericStorageId())); if ($row = $result->fetchRow()) { From bd3ead0d3181f74fd666b21ef83df8a6b2efc12d Mon Sep 17 00:00:00 2001 From: ringmaster Date: Thu, 14 Nov 2013 09:42:56 -0500 Subject: [PATCH 2/2] Compare dirname() results to DIRECTORY_SEPARATOR, not '/' --- lib/private/files/cache/updater.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/files/cache/updater.php b/lib/private/files/cache/updater.php index da22356700..d45c5e17fc 100644 --- a/lib/private/files/cache/updater.php +++ b/lib/private/files/cache/updater.php @@ -142,7 +142,7 @@ class Updater { $cache->update($id, array('mtime' => $time, 'etag' => $storage->getETag($internalPath))); if ($realPath !== '') { $realPath = dirname($realPath); - if($realPath === '/') { + if($realPath === DIRECTORY_SEPARATOR ) { $realPath = ""; } // check storage for parent in case we change the storage in this step