~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/select_safe.result

  • Committer: Brian Aker
  • Date: 2008-10-18 15:43:20 UTC
  • mto: (492.3.20 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081018154320-jc9jyij3mdf08abp
Updating tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
drop table if exists t1;
2
 
SET SQL_SELECT_LIMIT=4, MAX_JOIN_SIZE=9;
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 CROSS JOIN t1 as t2 CROSS JOIN 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 CROSS JOIN t1 as t2 CROSS JOIN t1 as t3 CROSS JOIN t1 as t4 CROSS JOIN t1 as t5;
28
 
1
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;
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
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
47
 
6       a
48
 
SET MAX_JOIN_SIZE=2;
49
 
SELECT * from t1;
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
51
 
SET MAX_JOIN_SIZE=DEFAULT;
52
 
SELECT * from t1;
53
 
a       b
54
 
3       a
55
 
4       a
56
 
5       a
57
 
6       a
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
64
 
1       SIMPLE  t1      index   b       PRIMARY 4       NULL    20      
65
 
1       SIMPLE  t2      ref     b       b       83      test.t1.b       10      Using where; Using index
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
69
 
1       SIMPLE  t1      index   b       PRIMARY 4       NULL    20      
70
 
1       SIMPLE  t2      ref     b       b       83      test.t1.b       10      Using where; Using index
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;
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
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;
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
84
 
set local  max_join_size=1;
85
 
select * from (select 1 union select 2 union select 3) x;
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
87
 
drop table t1;
88
 
SET SQL_SELECT_LIMIT=DEFAULT, MAX_JOIN_SIZE=DEFAULT;