summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_in.test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-10-13 13:44:50 +0200
committerSergei Golubchik <sergii@pisem.net>2011-10-13 13:44:50 +0200
commit9f6e24a05a32c147f292cd6260d63a31cb8cd9db (patch)
tree39d3b225cd0007319db0d31b7ce8f7494a724cf1 /mysql-test/t/func_in.test
parent76e9131fbe2157edbab53f34f2866070a55d2a17 (diff)
downloadmariadb-git-9f6e24a05a32c147f292cd6260d63a31cb8cd9db.tar.gz
lp:817966 int_column IN (string_constant)
restore the status quo from before the microsecond patch
Diffstat (limited to 'mysql-test/t/func_in.test')
-rw-r--r--mysql-test/t/func_in.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index 08469b37967..febec62f037 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -563,3 +563,23 @@ SELECT 1 IN (YEAR(FROM_UNIXTIME(NULL)) ,1);
--echo #
--echo End of 5.1 tests
+
+#
+# lp:817966 int_column IN (string_constant)
+#
+# rather illogically, when BIGINT field is compared to a string,
+# the string is converted to an integer, not to a double.
+# When some other integer field (not BIGINT) is compared to a string,
+# or when the BIGINT is not a field, but an expression, both
+# operands are compared as doubles. The latter behavior is correct,
+# according to the manual.
+#
+create table t1 (a bigint, b int);
+insert t1 values (1,1),(2,2),(3,3);
+select * from t1 where a in ('2.1');
+select * from t1 where b in ('2.1');
+select * from t1 where a='2.1';
+select * from t1 where b='2.1';
+select * from t1 where IF(1,a,a)='2.1';
+drop table t1;
+