summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <kroki/tomash@moonlight.intranet>2006-11-16 14:15:56 +0300
committerunknown <kroki/tomash@moonlight.intranet>2006-11-16 14:15:56 +0300
commitdb336c0544f76ffe322d6f747a4627d7f9d790a6 (patch)
tree887655dd59d97090c63cd7d4e3466b7b63a66918 /mysql-test
parentc6d317831ab8ccbef3685a5f03ca8c2cfa4d92f0 (diff)
parente40e8052e89ada24a79c827cf38271beed756759 (diff)
downloadmariadb-git-db336c0544f76ffe322d6f747a4627d7f9d790a6.tar.gz
Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-runtime
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-bug17047
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_in.result8
-rw-r--r--mysql-test/t/func_in.test22
2 files changed, 29 insertions, 1 deletions
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index 3cf2afc83d1..f74c63f7260 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -202,3 +202,11 @@ select count(*) from t1 where id not in (1,2);
count(*)
1
drop table t1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 SELECT 1 IN (2, NULL);
+SELECT should return NULL.
+SELECT * FROM t1;
+1 IN (2, NULL)
+NULL
+DROP TABLE t1;
+End of 4.1 tests
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index 2ffe5a2d5f7..ffed2aac2a0 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -109,4 +109,24 @@ select count(*) from t1 where id not in (1);
select count(*) from t1 where id not in (1,2);
drop table t1;
-# End of 4.1 tests
+
+#
+# BUG#17047: CHAR() and IN() can return NULL without signaling NULL
+# result
+#
+# The problem was in the IN() function that ignored maybe_null flags
+# of all arguments except the first (the one _before_ the IN
+# keyword, '1' in the test case below).
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 SELECT 1 IN (2, NULL);
+--echo SELECT should return NULL.
+SELECT * FROM t1;
+
+DROP TABLE t1;
+
+
+--echo End of 4.1 tests