~drizzle-trunk/drizzle/development

977.2.1 by Stewart Smith
Add test for SELECT IN () with NULL producing bad query plan. See https://bugs.launchpad.net/drizzle/+bug/357560 and http://bugs.mysql.com/bug.php?id=44139
1
#
2
# SELECT IN () with NULL in IN changes query plan
3
#
4
# http://bugs.mysql.com/bug.php?id=44139
5
# 
6
7
drop table if exists foo;
8
1165.2.3 by Stewart Smith
use MyISAM for tests so results for EXPLAIN are deterministic
9
create temporary table foo (
977.2.1 by Stewart Smith
Add test for SELECT IN () with NULL producing bad query plan. See https://bugs.launchpad.net/drizzle/+bug/357560 and http://bugs.mysql.com/bug.php?id=44139
10
	a int not null auto_increment,
11
	b int,
12
	primary key( a )
1165.2.3 by Stewart Smith
use MyISAM for tests so results for EXPLAIN are deterministic
13
) engine=myisam;
977.2.1 by Stewart Smith
Add test for SELECT IN () with NULL producing bad query plan. See https://bugs.launchpad.net/drizzle/+bug/357560 and http://bugs.mysql.com/bug.php?id=44139
14
15
insert into foo( b ) values (1),(1),(1),(1),(1);
1165.2.3 by Stewart Smith
use MyISAM for tests so results for EXPLAIN are deterministic
16
create table t2 as select * from foo;
17
insert into foo( b ) select b from t2;
18
drop table t2;
19
create table t2 as select * from foo;
20
insert into foo( b ) select b from t2;
21
drop table t2;
22
create table t2 as select * from foo;
23
insert into foo( b ) select b from t2;
24
drop table t2;
25
create table t2 as select * from foo;
26
insert into foo( b ) select b from t2;
27
drop table t2;
28
create table t2 as select * from foo;
29
insert into foo( b ) select b from t2;
30
drop table t2;
977.2.1 by Stewart Smith
Add test for SELECT IN () with NULL producing bad query plan. See https://bugs.launchpad.net/drizzle/+bug/357560 and http://bugs.mysql.com/bug.php?id=44139
31
32
explain select * from foo where a in (160000, 160001, 160002);
33
explain select * from foo where a in (null, 160000, 160001, 160002);
1165.2.2 by gshchepa at mysql
MySQL Bug #44139: Table scan when NULL appears in IN clause
34
DROP TABLE foo;