Skip to content

Commit

Permalink
Handle cached empty results in Query::execute(). Fixes #4032
Browse files Browse the repository at this point in the history
  • Loading branch information
cbandy committed Jul 4, 2011
1 parent 27d8ba4 commit e353340
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classes/kohana/database/query.php
Expand Up @@ -214,7 +214,7 @@ public function execute($db = NULL)
// 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 (($result = Kohana::cache($cache_key, NULL, $this->_lifetime)) !== NULL)
{
// Return a cached result
return new Database_Result_Cached($result, $sql, $this->_as_object, $this->_object_params);
Expand Down

0 comments on commit e353340

Please sign in to comment.