~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#
# SELECT IN () with NULL in IN changes query plan
#
# http://bugs.mysql.com/bug.php?id=44139
# 

drop table if exists foo;

create temporary table foo (
	a int not null auto_increment,
	b int,
	primary key( a )
) engine=myisam;

begin;
insert into foo( b ) values (1),(1),(1),(1),(1);
create table t2 as select * from foo;
insert into foo( b ) select b from t2;
drop table t2;
create table t2 as select * from foo;
insert into foo( b ) select b from t2;
drop table t2;
create table t2 as select * from foo;
insert into foo( b ) select b from t2;
drop table t2;
create table t2 as select * from foo;
insert into foo( b ) select b from t2;
drop table t2;
create table t2 as select * from foo;
insert into foo( b ) select b from t2;
drop table t2;
commit;

explain select * from foo where a in (160000, 160001, 160002);
explain select * from foo where a in (null, 160000, 160001, 160002);
DROP TABLE foo;