~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
drop table if exists t1;
2
create table t1 (a int not null default 0 primary key, b int not null default 0);
3
insert into t1 () values ();
4
insert into t1 values (1,1),(2,1),(3,1);
5
update t1 set a=4 where b=1 limit 1;
6
select * from t1;
7
a	b
8
0	0
9
2	1
10
3	1
383.2.2 by Jay Pipes
Updated limit test result after removal of prepared statements and dual references
11
4	1
1 by brian
clean slate
12
update t1 set b=2 where b=1 limit 2;
13
select * from t1;
14
a	b
15
0	0
16
2	2
383.2.2 by Jay Pipes
Updated limit test result after removal of prepared statements and dual references
17
3	2
18
4	1
1 by brian
clean slate
19
update t1 set b=4 where b=1;
20
select * from t1;
21
a	b
22
0	0
23
2	2
383.2.2 by Jay Pipes
Updated limit test result after removal of prepared statements and dual references
24
3	2
25
4	4
1 by brian
clean slate
26
delete from t1 where b=2 limit 1;
27
select * from t1;
28
a	b
29
0	0
383.2.2 by Jay Pipes
Updated limit test result after removal of prepared statements and dual references
30
3	2
31
4	4
1 by brian
clean slate
32
delete from t1 limit 1;
33
select * from t1;
34
a	b
383.2.2 by Jay Pipes
Updated limit test result after removal of prepared statements and dual references
35
3	2
36
4	4
1 by brian
clean slate
37
drop table t1;
38
create table t1 (i int);
39
insert into t1 (i) values(1),(1),(1);
40
delete from t1 limit 1;
41
update t1 set i=2 limit 1;
42
delete from t1 limit 0;
43
update t1 set i=3 limit 0;
44
select * from t1;
45
i
496.1.4 by Paul McCullagh
Changes to .result files to run both PBXT and InnoDB
46
1
1 by brian
clean slate
47
2
48
drop table t1;
49
select 0 limit 0;
50
0
51
CREATE TABLE t1(id int auto_increment primary key, id2 int, index(id2));
52
INSERT INTO t1 (id2) values (0),(0),(0);
53
DELETE FROM t1 WHERE id=1;
54
INSERT INTO t1 SET id2=0;
55
SELECT * FROM t1;
56
id	id2
57
2	0
58
3	0
383.2.2 by Jay Pipes
Updated limit test result after removal of prepared statements and dual references
59
4	0
1 by brian
clean slate
60
DELETE FROM t1 WHERE id2 = 0 ORDER BY id LIMIT 1;
61
SELECT * FROM t1;
62
id	id2
383.2.2 by Jay Pipes
Updated limit test result after removal of prepared statements and dual references
63
3	0
1 by brian
clean slate
64
4	0
65
DELETE FROM t1 WHERE id2 = 0 ORDER BY id desc LIMIT 1;
66
SELECT * FROM t1;
67
id	id2
68
3	0
69
DROP TABLE t1;
70
create table t1 (a int);
71
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
72
explain select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
73
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
74
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	7	Using where; Using temporary
75
select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
76
c
77
7
78
explain select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
79
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
80
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	7	Using where; Using temporary
81
select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
82
c
83
28
84
drop table t1;
85
End of 5.0 tests