summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/database/DB_query_builder.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index a36501eb6..95c3af3a9 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -2551,11 +2551,13 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
$qb_variable = 'qb_'.$val;
$qb_cache_var = 'qb_cache_'.$val;
- if (count($this->$qb_cache_var) === 0)
+ if (count($this->$qb_cache_var) > 0)
{
- continue;
+ foreach ($this->$qb_cache_var as &$cache_var)
+ {
+ in_array($cache_var, $this->$qb_variable, TRUE) OR $this->$qb_variable[] = $cache_var;
+ }
}
- $this->$qb_variable = array_merge($this->$qb_variable, array_diff($this->$qb_cache_var, $this->$qb_variable));
}
// If we are "protecting identifiers" we need to examine the "from"