summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_active_rec.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index 17cdc3220..4eff400c1 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -427,7 +427,7 @@ class CI_DB_active_record extends CI_DB_driver {
{
$prefix = (count($this->ar_where) == 0) ? '' : $type;
- if ( ! $this->_has_operator($k) && is_null($key[$k]))
+ if (is_null($v) && ! $this->_has_operator($k))
{
// value appears not to have been set, assign the test to IS NULL
$k .= ' IS NULL';
@@ -447,6 +447,9 @@ class CI_DB_active_record extends CI_DB_driver {
{
$k = $this->_protect_identifiers($k);
}
+
+ $v = ' '.$this->escape($v);
+
}
if ( ! $this->_has_operator($k))
@@ -454,11 +457,6 @@ class CI_DB_active_record extends CI_DB_driver {
$k .= ' =';
}
- if ($v !== NULL AND $escape === TRUE)
- {
- $v = ' '.$this->escape($v);
- }
-
}
else
{
@@ -471,6 +469,7 @@ class CI_DB_active_record extends CI_DB_driver {
}
$this->ar_where[] = $prefix.$k.$v;
+
if ($this->ar_caching === TRUE)
{
$this->ar_cache_where[] = $prefix.$k.$v;