summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2006-05-30 18:57:08 +0400
committerunknown <evgen@moonbone.local>2006-05-30 18:57:08 +0400
commita9824f263dcaedaabfbbc9e398eb55117f19a41f (patch)
tree20b81b6ecc616520415d9e5ec251ac8f3fb2a194 /mysql-test
parent2264b644735e869fdbb16397c75170d86e2de127 (diff)
parentc007dabaf62b7ac7eb41e2460b12d652b132bb7f (diff)
downloadmariadb-git-a9824f263dcaedaabfbbc9e398eb55117f19a41f.tar.gz
Merge moonbone.local:/work/18630-bug-4.1-mysql
into moonbone.local:/work/18360-bug-4.1-mysql-opt
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_in.result21
-rw-r--r--mysql-test/t/func_in.test12
2 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result
index 3cf2afc83d1..0632dddb87e 100644
--- a/mysql-test/r/func_in.result
+++ b/mysql-test/r/func_in.result
@@ -202,3 +202,24 @@ select count(*) from t1 where id not in (1,2);
count(*)
1
drop table t1;
+create table t1 (f1 char(1), f2 int);
+insert into t1 values (1,0),('a',1),('z',2);
+select f1 from t1 where f1 in (1,'z');
+f1
+1
+z
+select f2 from t1 where f2 in (1,'z');
+f2
+0
+1
+select f1 from t1 where 'z' in (1,f1);
+f1
+z
+select * from t1 where 'z' in (f2,f1);
+f1 f2
+z 2
+select * from t1 where 1 in (f2,f1);
+f1 f2
+1 0
+a 1
+drop table t1;
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index 2ffe5a2d5f7..3481f2c7b11 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -109,4 +109,16 @@ select count(*) from t1 where id not in (1);
select count(*) from t1 where id not in (1,2);
drop table t1;
+#
+# Bug#18360 Incorrect type coercion in IN() results in false comparison
+#
+create table t1 (f1 char(1), f2 int);
+insert into t1 values (1,0),('a',1),('z',2);
+select f1 from t1 where f1 in (1,'z');
+select f2 from t1 where f2 in (1,'z');
+select f1 from t1 where 'z' in (1,f1);
+select * from t1 where 'z' in (f2,f1);
+select * from t1 where 1 in (f2,f1);
+drop table t1;
+
# End of 4.1 tests