1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

lp:817966 int_column IN (string_constant)

restore the status quo from before the microsecond patch
This commit is contained in:
Sergei Golubchik
2011-10-13 13:44:50 +02:00
parent 76e9131fbe
commit 9f6e24a05a
8 changed files with 64 additions and 23 deletions

View File

@@ -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;