summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_if.test
diff options
context:
space:
mode:
authorunknown <igor@igor-inspiron.creware.com>2005-06-13 11:24:26 -0700
committerunknown <igor@igor-inspiron.creware.com>2005-06-13 11:24:26 -0700
commit89906482e0271824209d995a37a2265dee3bd4cf (patch)
tree7f90f7bc594a0ddf5ca1cc0008a1a291946590df /mysql-test/t/func_if.test
parente802cd3bc70833684e89913fa6e2828a6f80df79 (diff)
downloadmariadb-git-89906482e0271824209d995a37a2265dee3bd4cf.tar.gz
func_if.result, func_if.test:
Added a test case for bug #11142. item_cmpfunc.cc: Fixed bug #11142. Implementation of Item_func_nullif::is_null was corrected. sql/item_cmpfunc.cc: Fixed bug #11142. Implementation of Item_func_nullif::is_null was corrected. mysql-test/t/func_if.test: Added a test case for bug #11142. mysql-test/r/func_if.result: Added a test case for bug #11142.
Diffstat (limited to 'mysql-test/t/func_if.test')
-rw-r--r--mysql-test/t/func_if.test27
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test
index 693773b18c8..ae820fae93b 100644
--- a/mysql-test/t/func_if.test
+++ b/mysql-test/t/func_if.test
@@ -60,3 +60,30 @@ drop table t1;
# Bug #5595 NULLIF() IS NULL returns false if NULLIF() returns NULL
#
SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL;
+#
+# Test to check evaluation of MULLIF when the first argument is NULL
+# (motivated by the Bug 11142)
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (a CHAR(10));
+INSERT INTO t1 VALUES ('aaa'), (NULL), (''), ('bbb');
+SELECT a, NULLIF(a,'') FROM t1;
+SELECT a, NULLIF(a,'') FROM t1 WHERE NULLIF(a,'') IS NULL;
+
+DROP TABLE t1;
+
+#
+# Test for bug #11142: evaluation of NULLIF when the first argument is NULL
+#
+
+CREATE TABLE t1 (a CHAR(10));
+INSERT INTO t1 VALUES ('aaa'), (NULL), (''), ('bbb');
+
+SELECT a, NULLIF(a,'') FROM t1;
+SELECT a, NULLIF(a,'') FROM t1 WHERE NULLIF(a,'') IS NULL;
+
+DROP TABLE t1;