mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-runtime
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-4.1-bug17047
This commit is contained in:
commit
690cb27d05
3 changed files with 29 additions and 2 deletions
|
@ -202,3 +202,11 @@ select count(*) from t1 where id not in (1,2);
|
|||
count(*)
|
||||
1
|
||||
drop table t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 SELECT 1 IN (2, NULL);
|
||||
SELECT should return NULL.
|
||||
SELECT * FROM t1;
|
||||
1 IN (2, NULL)
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
End of 4.1 tests
|
||||
|
|
|
@ -109,4 +109,24 @@ 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
|
||||
|
|
|
@ -1998,7 +1998,6 @@ void Item_func_in::fix_length_and_dec()
|
|||
if (cmp_type == STRING_RESULT)
|
||||
in_item->cmp_charset= cmp_collation.collation;
|
||||
}
|
||||
maybe_null= args[0]->maybe_null;
|
||||
max_length= 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue