summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_in.test
diff options
context:
space:
mode:
authorunknown <kroki/tomash@moonlight.intranet>2006-11-16 14:13:03 +0300
committerunknown <kroki/tomash@moonlight.intranet>2006-11-16 14:13:03 +0300
commit5cb0011de73419db7ea8c736030c4add83e94620 (patch)
treeef824e40692b4feb07161bc9d403ccf6b01d03a0 /mysql-test/t/func_in.test
parentf09031ee36d60f892e5629f930b45aaf5f9501f3 (diff)
parentaf22eb35e577ef17226faf662f2cffc4705bde26 (diff)
downloadmariadb-git-5cb0011de73419db7ea8c736030c4add83e94620.tar.gz
Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug17047
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-bug17047 sql/item_cmpfunc.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_strfunc.h: Auto merged mysql-test/r/func_in.result: Manual merge. Add "End of <version> tests" marker. mysql-test/r/func_str.result: Manual merge. Add "End of <version> tests" marker. mysql-test/t/func_in.test: Manual merge. Add "End of <version> tests" marker. mysql-test/t/func_str.test: Manual merge. Add "End of <version> tests" marker.
Diffstat (limited to 'mysql-test/t/func_in.test')
-rw-r--r--mysql-test/t/func_in.test30
1 files changed, 29 insertions, 1 deletions
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index 906747c2f78..ee344d0958b 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -109,7 +109,28 @@ 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
+
#
# Bug #11885: WHERE condition with NOT IN (one element)
@@ -233,6 +254,10 @@ select some_id from t1 where some_id not in(-4,-1,-4);
select some_id from t1 where some_id not in(-4,-1,3423534,2342342);
drop table t1;
+
+--echo End of 5.0 tests
+
+
#
# Bug#18360: Type aggregation for IN and CASE may lead to a wrong result
#
@@ -256,3 +281,6 @@ explain select f2 from t2 where f2 in ('a','b');
select f2 from t2 where f2 in (1,'b');
explain select f2 from t2 where f2 in (1,'b');
drop table t1, t2;
+
+
+--echo End of 5.1 tests