~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
drop table if exists t1;
1237.6.1 by Brian Aker
Remove dead bits in parser/whitespace/etc.
2
SET SQL_SELECT_LIMIT=4, MAX_JOIN_SIZE=9;
1 by brian
clean slate
3
create table t1 (a int auto_increment primary key, b char(20));
4
insert into t1 values(1,"test");
5
SELECT SQL_BUFFER_RESULT * from t1;
6
a	b
7
1	test
8
update t1 set b="a" where a=1;
9
delete from t1 where a=1;
10
insert into t1 values(1,"test"),(2,"test2");
11
SELECT SQL_BUFFER_RESULT * from t1;
12
a	b
13
1	test
14
2	test2
15
update t1 set b="a" where a=1;
16
select 1 from t1,t1 as t2,t1 as t3;
17
1
18
1
19
1
20
1
21
1
22
update t1 set b="a";
23
update t1 set b="a" where b="test";
24
delete from t1;
25
delete from t1 where b="test";
26
delete from t1 where a+0=1;
27
select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5;
1237.6.1 by Brian Aker
Remove dead bits in parser/whitespace/etc.
28
1
1 by brian
clean slate
29
update t1 set b="a" limit 1;
30
update t1 set b="a" where b="b" limit 2;
31
delete from t1 where b="test" limit 1;
32
delete from t1 where a+0=1 limit 2;
33
alter table t1 add key b (b);
34
SET MAX_JOIN_SIZE=2;
35
SELECT @@MAX_JOIN_SIZE, @@SQL_BIG_SELECTS;
36
@@MAX_JOIN_SIZE	@@SQL_BIG_SELECTS
37
2	0
38
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
39
SELECT * from t1 order by a;
673.3.24 by Stewart Smith
fix select_safe and http://bugs.mysql.com/bug.php?id=32250 (but for Drizzle)
40
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
1 by brian
clean slate
41
SET SQL_BIG_SELECTS=1;
42
SELECT * from t1 order by a;
43
a	b
44
3	a
45
4	a
46
5	a
1237.6.1 by Brian Aker
Remove dead bits in parser/whitespace/etc.
47
6	a
1 by brian
clean slate
48
SET MAX_JOIN_SIZE=2;
49
SELECT * from t1;
673.3.24 by Stewart Smith
fix select_safe and http://bugs.mysql.com/bug.php?id=32250 (but for Drizzle)
50
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
1 by brian
clean slate
51
SET MAX_JOIN_SIZE=DEFAULT;
52
SELECT * from t1;
53
a	b
54
3	a
55
4	a
56
5	a
1237.6.1 by Brian Aker
Remove dead bits in parser/whitespace/etc.
57
6	a
1 by brian
clean slate
58
analyze table t1;
59
Table	Op	Msg_type	Msg_text
60
test.t1	analyze	status	OK
61
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
62
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
63
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1237.6.1 by Brian Aker
Remove dead bits in parser/whitespace/etc.
64
1	SIMPLE	t1	index	b	PRIMARY	4	NULL	20	
1685.7.6 by Patrick Crews
Updated test results with changes due to optimizer bug fix. EXPLAIN output now includes 'Using where' for several queries that didn't previously have this output
65
1	SIMPLE	t2	ref	b	b	83	test.t1.b	10	Using where; Using index
1 by brian
clean slate
66
set MAX_SEEKS_FOR_KEY=1;
67
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
68
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1237.6.1 by Brian Aker
Remove dead bits in parser/whitespace/etc.
69
1	SIMPLE	t1	index	b	PRIMARY	4	NULL	20	
1685.7.6 by Patrick Crews
Updated test results with changes due to optimizer bug fix. EXPLAIN output now includes 'Using where' for several queries that didn't previously have this output
70
1	SIMPLE	t2	ref	b	b	83	test.t1.b	10	Using where; Using index
1 by brian
clean slate
71
SET MAX_SEEKS_FOR_KEY=DEFAULT;
72
drop table t1;
73
create table t1 (a int);
74
insert into t1 values (1),(2),(3),(4),(5);
75
insert into t1 select * from t1;
76
insert into t1 select * from t1;
77
insert into t1 select * from t1;
78
set local  max_join_size=8;
79
select * from (select * from t1) x;
673.3.24 by Stewart Smith
fix select_safe and http://bugs.mysql.com/bug.php?id=32250 (but for Drizzle)
80
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
1 by brian
clean slate
81
set local  max_join_size=1;
82
select * from (select a.a as aa, b.a as ba from t1 a, t1 b) x;
673.3.24 by Stewart Smith
fix select_safe and http://bugs.mysql.com/bug.php?id=32250 (but for Drizzle)
83
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
1 by brian
clean slate
84
set local  max_join_size=1;
85
select * from (select 1 union select 2 union select 3) x;
673.3.24 by Stewart Smith
fix select_safe and http://bugs.mysql.com/bug.php?id=32250 (but for Drizzle)
86
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
1 by brian
clean slate
87
drop table t1;
1237.6.1 by Brian Aker
Remove dead bits in parser/whitespace/etc.
88
SET SQL_SELECT_LIMIT=DEFAULT, MAX_JOIN_SIZE=DEFAULT;