[eluser]mark17[/eluser]
A quick patch for this problem is switching two sequentiel codeblocks in DB_Driver.php starting at line #270;
OLD CODE:
Code:
// Is query caching enabled? If the query is a "read type"
// we will load the caching class and return the previously
// cached query if it exists
if ($this->cache_on == TRUE AND stristr($sql, 'SELECT'))
{
if ($this->_cache_init())
{
$this->load_rdriver();
if (FALSE !== ($cache = $this->CACHE->read($sql)))
{
return $cache;
}
}
}
// Compile binds if needed
if ($binds !== FALSE)
{
$sql = $this->compile_binds($sql, $binds);
}
PATCH CODE:
Code:
// Compile binds if needed
if ($binds !== FALSE)
{
$sql = $this->compile_binds($sql, $binds);
}
// Is query caching enabled? If the query is a "read type"
// we will load the caching class and return the previously
// cached query if it exists
if ($this->cache_on == TRUE AND stristr($sql, 'SELECT'))
{
if ($this->_cache_init())
{
$this->load_rdriver();
if (FALSE !== ($cache = $this->CACHE->read($sql)))
{
return $cache;
}
}
}
This will parse the prepared statement _before_ attempting to compile a filename in DB_Cache itself. I cannot understand that this has been around for quite some time without anyone noticing. Of course, this old behaviour will never surface in altering the state of the data but will result in loss in performance when relying on it.
Please submit this patch in future versions.