Welcome Guest, Not a member yet? Register   Sign In
Cache bug in DB_Driver.php?
#1

[eluser]august.gresens[/eluser]
Hello

The query caching in 1.7 did not seem to be working.

I traced the problem to the query method. The binds were not being compiled until AFTER the query cache was checked. Because the sql query contained the "?" characters, it never made a checksum match for a cached query.

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;
        }
    }
}

The query cache now seems to work.

Is this a bug fix or am I missing something?

I normally don't like to touch the CI files..

Thanks,


August
#2

[eluser]mark17[/eluser]
Don't bother my friend, keep your patches in mind and apply them yourself for the next year orso.
http://ellislab.com/forums/viewthread/89929/




Theme © iAndrew 2016 - Forum software by © MyBB