From 7e6aba1484f1b9a32bf97f2a9a654a503c8eb86f Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Thu, 21 Aug 2014 20:04:52 +0300 Subject: Query builder: IS NOT NULL support implementation, see #3194 --- system/database/DB_query_builder.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'system') 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) -- cgit v1.2.3-24-g4f1b From a3cc8084a73e2c58a9ac38963bf7f60ba50d213e Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Fri, 22 Aug 2014 12:00:05 +0300 Subject: Query builder, IS NOT NULL support #3194: Strict comparison. --- system/database/DB_query_builder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system') diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index c75a46908..69dc8c2d1 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -665,7 +665,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { { $operator = trim($this->_get_operator($k)); - if ($operator == '<>' OR $operator == '!=') + if ($operator === '<>' OR $operator === '!=') { $k = str_replace($operator, ' IS NOT NULL', $k); } -- cgit v1.2.3-24-g4f1b