1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug #37761: IN handles NULL differently for table-subquery

and value-list

The server returns unexpected results if a right side of the 
NOT IN clause consists of NULL value and some constants of
the same type, for example:

  SELECT * FROM t WHERE NOT t.id IN (NULL, 1, 2) 
  
may return 3, 4, 5 etc if a table contains these values.


The Item_func_in::val_int method has been modified:
unnecessary resets of an Item_func_case::has_null field 
value has been moved outside of an argument comparison
loop. (Also unnecessary re-initialization of the null_value
field has been moved).
This commit is contained in:
Gleb Shchepa
2008-07-14 14:06:49 +05:00
parent 6d05a62e4a
commit 211164ff8c
3 changed files with 18 additions and 3 deletions

View File

@ -569,4 +569,10 @@ insert into t1 values (),(),(),(),(),(),(),(),(),();
select a from t1 where a not in (a,a,a) group by a;
a
drop table t1;
create table t1 (id int);
select * from t1 where NOT id in (select null union all select 1);
id
select * from t1 where NOT id in (null, 1);
id
drop table t1;
End of 5.1 tests