summaryrefslogtreecommitdiffstats
path: root/system/database/DB_driver.php
diff options
context:
space:
mode:
authorRyan Dial <rrdial@gmail.com>2012-03-01 22:11:36 +0100
committerRyan Dial <rrdial@gmail.com>2012-03-01 22:11:36 +0100
commitef7474c6ca9887283c964e17c450ca09559643c4 (patch)
treefb16fed419736d98ad722bb2da23eb42d4c54220 /system/database/DB_driver.php
parentdb6066511bfc1a728049fdadaad14f1d10cd9796 (diff)
compile binds before caching the query, otherwise the cached query will never match the unbound query. updated changlog to mention bug fix.
Diffstat (limited to 'system/database/DB_driver.php')
-rw-r--r--system/database/DB_driver.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index 4dfb584f2..6161f149b 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -265,6 +265,12 @@ class CI_DB_driver {
$sql = preg_replace("/(\W)".$this->swap_pre."(\S+?)/", "\\1".$this->dbprefix."\\2", $sql);
}
+ // 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
@@ -280,12 +286,6 @@ class CI_DB_driver {
}
}
- // Compile binds if needed
- if ($binds !== FALSE)
- {
- $sql = $this->compile_binds($sql, $binds);
- }
-
// Save the query for debugging
if ($this->save_queries == TRUE)
{