summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2014-11-02 01:08:09 +0400
committerAlexander Barkov <bar@mnogosearch.org>2014-11-02 01:08:09 +0400
commitd1ca1c1faeb1e43df1533a10dfa0ac79433227f9 (patch)
tree47c81a1d7d0c9d17cce66be1784f21dc13b6fb5a /mysql-test
parent4dec4e1175b6494c6ba952fa3eac528ac9649888 (diff)
downloadmariadb-git-d1ca1c1faeb1e43df1533a10dfa0ac79433227f9.tar.gz
MDEV-7001 Bad result for NOT NOT STRCMP('a','b') and NOT NOT NULLIF(2,3)
The bug is not very important per se, but it was helpful to move Item_func_strcmp out of Item_bool_func2 (to Item_int_func), for the purposes of "MDEV-4912 Add a plugin to field types (column types)".
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_test.result17
-rw-r--r--mysql-test/r/null.result12
-rw-r--r--mysql-test/t/func_test.test14
-rw-r--r--mysql-test/t/null.test13
4 files changed, 56 insertions, 0 deletions
diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result
index 2c1c416472f..97ef61047a5 100644
--- a/mysql-test/r/func_test.result
+++ b/mysql-test/r/func_test.result
@@ -320,3 +320,20 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (not((`test`.`t1`.`a` + 0)))
drop table t1;
+#
+# Start of 10.0 tests
+#
+#
+# MDEV-7001 Bad result for NOT NOT STRCMP('a','b') and NOT NOT NULLIF(2,3)
+#
+SELECT NOT NOT strcmp('a','b');
+NOT NOT strcmp('a','b')
+1
+EXPLAIN EXTENDED SELECT NOT NOT strcmp('a','b');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 select (strcmp('a','b') <> 0) AS `NOT NOT strcmp('a','b')`
+#
+# End of 10.0 tests
+#
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index ce233e0db23..b5219333ef1 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -382,3 +382,15 @@ CREATE TABLE t2 (d DATE) ENGINE=MyISAM;
SELECT * FROM t1,t2 WHERE 1 IS NOT NULL AND t1.b IS NULL;
a b c d
DROP TABLE t1,t2;
+#
+# Start of 10.0 tests
+#
+#
+# MDEV-7001 Bad result for NOT NOT STRCMP('a','b') and NOT NOT NULLIF(2,3)
+#
+SELECT NOT NOT NULLIF(2,3);
+NOT NOT NULLIF(2,3)
+1
+#
+# End of 10.0 tests
+#
diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test
index 6a99b975e81..d3703de26c5 100644
--- a/mysql-test/t/func_test.test
+++ b/mysql-test/t/func_test.test
@@ -180,3 +180,17 @@ select * from t1 where not (a+0);
explain extended select * from t1 where not (a+0);
drop table t1;
+
+--echo #
+--echo # Start of 10.0 tests
+--echo #
+
+--echo #
+--echo # MDEV-7001 Bad result for NOT NOT STRCMP('a','b') and NOT NOT NULLIF(2,3)
+--echo #
+SELECT NOT NOT strcmp('a','b');
+EXPLAIN EXTENDED SELECT NOT NOT strcmp('a','b');
+
+--echo #
+--echo # End of 10.0 tests
+--echo #
diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test
index 81951a9ce68..40f66946822 100644
--- a/mysql-test/t/null.test
+++ b/mysql-test/t/null.test
@@ -295,3 +295,16 @@ CREATE TABLE t2 (d DATE) ENGINE=MyISAM;
SELECT * FROM t1,t2 WHERE 1 IS NOT NULL AND t1.b IS NULL;
DROP TABLE t1,t2;
+
+--echo #
+--echo # Start of 10.0 tests
+--echo #
+
+--echo #
+--echo # MDEV-7001 Bad result for NOT NOT STRCMP('a','b') and NOT NOT NULLIF(2,3)
+--echo #
+SELECT NOT NOT NULLIF(2,3);
+
+--echo #
+--echo # End of 10.0 tests
+--echo #