From ae2c1440eda07ddad2d96aa3d6df5b492bb38363 Mon Sep 17 00:00:00 2001 From: Deon George Date: Tue, 31 May 2011 10:43:30 +1000 Subject: [PATCH] Upstream Patch: Fix caching for cache hits with no records --- .../kohana/modules/database/classes/kohana/database/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/kohana/modules/database/classes/kohana/database/query.php b/includes/kohana/modules/database/classes/kohana/database/query.php index 96db093..f08f3c1 100644 --- a/includes/kohana/modules/database/classes/kohana/database/query.php +++ b/includes/kohana/modules/database/classes/kohana/database/query.php @@ -214,7 +214,7 @@ class Kohana_Database_Query { // Set the cache key based on the database instance name and SQL $cache_key = 'Database::query("'.$db.'", "'.$sql.'")'; - if ($result = Kohana::cache($cache_key, NULL, $this->_lifetime)) + if (! is_null($result = Kohana::cache($cache_key, NULL, $this->_lifetime))) { // Return a cached result return new Database_Result_Cached($result, $sql, $this->_as_object, $this->_object_params);