~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/select_safe.test

  • Committer: Brian Aker
  • Date: 2009-10-15 00:22:33 UTC
  • mto: (1183.1.11 merge)
  • mto: This revision was merged to the branch mainline in revision 1198.
  • Revision ID: brian@gaz-20091015002233-fa4ao2mbc67wls91
First pass of information engine. OMG, ponies... is it so much easier to
deal with creating and engine.

The list table iterator though... its ass, needs to go. We should also
abstract out share. Very few engines need a custom one. Just say'in

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
drop table if exists t1;
7
7
--enable_warnings
8
8
 
9
 
SET SQL_SELECT_LIMIT=4, MAX_JOIN_SIZE=9;
 
9
SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, MAX_JOIN_SIZE=9;
10
10
create table t1 (a int auto_increment primary key, b char(20));
11
11
insert into t1 values(1,"test");
12
 
--sorted_result
13
12
SELECT SQL_BUFFER_RESULT * from t1;
14
13
update t1 set b="a" where a=1;
15
14
delete from t1 where a=1;
16
15
insert into t1 values(1,"test"),(2,"test2");
17
 
--sorted_result
18
16
SELECT SQL_BUFFER_RESULT * from t1;
19
17
update t1 set b="a" where a=1;
20
18
select 1 from t1,t1 as t2,t1 as t3;
21
19
 
22
 
# The following should NOT give errors:
 
20
# The following should give errors:
 
21
--error 1175
23
22
update t1 set b="a";
 
23
--error 1175
24
24
update t1 set b="a" where b="test";
 
25
--error 1175
25
26
delete from t1;
 
27
--error 1175
26
28
delete from t1 where b="test";
 
29
--error 1175
27
30
delete from t1 where a+0=1;
 
31
--error 1104
28
32
select 1 from t1,t1 as t2,t1 as t3,t1 as t4,t1 as t5;
29
33
 
30
34
# The following should be ok:
39
43
SET MAX_JOIN_SIZE=2;
40
44
SELECT @@MAX_JOIN_SIZE, @@SQL_BIG_SELECTS;
41
45
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
42
 
--error ER_TOO_BIG_SELECT
 
46
--error 1104
43
47
SELECT * from t1 order by a;
44
48
SET SQL_BIG_SELECTS=1;
45
49
SELECT * from t1 order by a;
46
50
SET MAX_JOIN_SIZE=2;
47
 
--error ER_TOO_BIG_SELECT
 
51
--error 1104
48
52
SELECT * from t1;
49
53
SET MAX_JOIN_SIZE=DEFAULT;
50
54
SELECT * from t1;
69
73
insert into t1 select * from t1;
70
74
 
71
75
set local  max_join_size=8;
72
 
--error ER_TOO_BIG_SELECT
 
76
--error 1104
73
77
select * from (select * from t1) x;
74
78
 
75
79
set local  max_join_size=1;
76
 
--error ER_TOO_BIG_SELECT
 
80
--error 1104
77
81
select * from (select a.a as aa, b.a as ba from t1 a, t1 b) x;
78
82
 
79
83
set local  max_join_size=1;
80
 
--error ER_TOO_BIG_SELECT
 
84
--error 1104
81
85
select * from (select 1 union select 2 union select 3) x;
82
86
drop table t1;
83
87
 
84
 
SET SQL_SELECT_LIMIT=DEFAULT, MAX_JOIN_SIZE=DEFAULT;
 
88
SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, MAX_JOIN_SIZE=DEFAULT;
85
89
 
86
90
# End of 4.1 tests