diff options
Diffstat (limited to 'mysql-test/t/func_in.test')
-rw-r--r-- | mysql-test/t/func_in.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index 9e054da3fe2..fea3a2ed6d3 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -587,3 +587,22 @@ EXECUTE s; DROP TABLE t1; +# +# 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; +--echo # End of 5.3 tests |