diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-02 00:40:24 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-02 00:40:24 +0100 |
commit | 1887c6d4847fd9d4251b58aba599cb8ee63d2e38 (patch) | |
tree | fb16fed419736d98ad722bb2da23eb42d4c54220 | |
parent | db6066511bfc1a728049fdadaad14f1d10cd9796 (diff) | |
parent | ef7474c6ca9887283c964e17c450ca09559643c4 (diff) |
Merge pull request #1100 from rrdial/2.1-stable
2.1-stable: bug fix: compile binds before caching the query…
-rw-r--r-- | system/database/DB_driver.php | 12 | ||||
-rw-r--r-- | user_guide/changelog.html | 1 |
2 files changed, 7 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) { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 76a0bcb19..b87e61ba8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -79,6 +79,7 @@ Change Log <li>Fixed a bug - form_open() compared $action against site_url() instead of base_url()</li> <li>Fixed a bug - CI_Upload::_file_mime_type() could've failed if mime_content_type() is used for the detection and returns FALSE.</li> <li>Fixed a bug (#538) - Windows paths were ignored when using the <a href="libraries/image_lib.html">Image Manipulation Class</a> to create a new file.</li> + <li>Fixed a bug - When database caching was enabled, $this->db->query() checked the cache before binding variables which resulted in cached queries never being found.</li> </ul> |