~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
drop table if exists foo;
2
Warnings:
3
Note	1051	Unknown table 'foo'
1165.2.3 by Stewart Smith
use MyISAM for tests so results for EXPLAIN are deterministic
4
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
5
a int not null auto_increment,
6
b int,
7
primary key( a )
1165.2.3 by Stewart Smith
use MyISAM for tests so results for EXPLAIN are deterministic
8
) 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
9
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
10
create table t2 as select * from foo;
11
insert into foo( b ) select b from t2;
12
drop table t2;
13
create table t2 as select * from foo;
14
insert into foo( b ) select b from t2;
15
drop table t2;
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;
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
25
explain select * from foo where a in (160000, 160001, 160002);
26
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
27
1	SIMPLE	foo	range	PRIMARY	PRIMARY	4	NULL	3	Using where
28
explain select * from foo where a in (null, 160000, 160001, 160002);
29
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1165.2.2 by gshchepa at mysql
MySQL Bug #44139: Table scan when NULL appears in IN clause
30
1	SIMPLE	foo	range	PRIMARY	PRIMARY	4	NULL	3	Using where
31
DROP TABLE foo;