diff options
author | Ivan Tcholakov <ivantcholakov@gmail.com> | 2014-08-21 19:04:52 +0200 |
---|---|---|
committer | Ivan Tcholakov <ivantcholakov@gmail.com> | 2014-08-21 19:04:52 +0200 |
commit | 7e6aba1484f1b9a32bf97f2a9a654a503c8eb86f (patch) | |
tree | 6adf22abb9ae70ffaf5d40d1fea6f16b8320df45 /system/database/DB_query_builder.php | |
parent | 1b634f8b10de437a18982a91ccc78aee4be1c685 (diff) |
Query builder: IS NOT NULL support implementation, see #3194
Diffstat (limited to 'system/database/DB_query_builder.php')
-rw-r--r-- | system/database/DB_query_builder.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index 085c615e5..c75a46908 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -661,6 +661,15 @@ abstract class CI_DB_query_builder extends CI_DB_driver { // value appears not to have been set, assign the test to IS NULL $k .= ' IS NULL'; } + else + { + $operator = trim($this->_get_operator($k)); + + if ($operator == '<>' OR $operator == '!=') + { + $k = str_replace($operator, ' IS NOT NULL', $k); + } + } $this->{$qb_key}[] = array('condition' => $prefix.$k.$v, 'escape' => $escape); if ($this->qb_caching === TRUE) |