~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/read_many_rows_innodb.result

  • Committer: Brian Aker
  • Date: 2008-12-16 22:26:59 UTC
  • mfrom: (673.3.9 tests)
  • Revision ID: brian@tangent.org-20081216222659-066d8awi29paz0og
Merging in Stewart's tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
CREATE TABLE t2 (id INTEGER PRIMARY KEY);
5
5
CREATE TABLE t3 (a CHAR(32) PRIMARY KEY,id INTEGER);
6
6
CREATE TABLE t4 (a CHAR(32) PRIMARY KEY,id INTEGER) ENGINE=MyISAM;
 
7
begin;
7
8
INSERT INTO t1 (id) VALUES (1);
8
9
INSERT INTO t1 SELECT id+1 FROM t1;
9
10
INSERT INTO t1 SELECT id+2 FROM t1;
33
34
SUM(id)
34
35
2199024304128
35
36
DROP TABLE t1,t2,t3,t4;
36
 
CREATE TABLE t1 (f1 int NOT NULL) ENGINE=InnoDB;
37
 
CREATE TABLE t2 (f2 int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
38
 
CREATE TRIGGER t1_bi before INSERT
39
 
ON t1 FOR EACH ROW
40
 
BEGIN
41
 
DECLARE CONTINUE HANDLER FOR SQLSTATE '40001' SET @a:= 'deadlock';
42
 
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception';
43
 
INSERT INTO t2 (f2) VALUES (1);
44
 
DELETE FROM t2 WHERE f2 = 1;
45
 
END;|
46
 
CREATE PROCEDURE proc24989()
47
 
BEGIN
48
 
DECLARE CONTINUE HANDLER FOR SQLSTATE '40001' SET @b:= 'deadlock';
49
 
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception';
50
 
INSERT INTO t2 (f2) VALUES (1);
51
 
DELETE FROM t2 WHERE f2 = 1;
52
 
END;|
53
 
create procedure proc24989_2()
54
 
deterministic
55
 
begin
56
 
declare continue handler for sqlexception
57
 
select 'Outer handler' as 'exception';
58
 
insert into t1 values(1);
59
 
select "continued";
60
 
end|
61
 
start transaction;
62
 
insert into t1 values(1);
63
 
start transaction;
64
 
insert into t2 values(123);
65
 
insert into t1 values(1);
66
 
insert into t1 values(1);
67
 
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
68
 
select @a;
69
 
@a
70
 
NULL
71
 
select * from t2;
72
 
f2
73
 
commit;
74
 
start transaction;
75
 
insert into t1 values(1);
76
 
start transaction;
77
 
insert into t2 values(123);
78
 
call proc24989();
79
 
insert into t1 values(1);
80
 
select @a,@b;
81
 
@a      @b
82
 
exception       deadlock
83
 
select * from t2;
84
 
f2
85
 
commit;
86
 
start transaction;
87
 
insert into t1 values(1);
88
 
start transaction;
89
 
insert into t2 values(123);
90
 
call proc24989_2();
91
 
insert into t1 values(1);
92
 
commit;
93
 
exception
94
 
Outer handler
95
 
continued
96
 
continued
97
 
select * from t2;
98
 
f2
99
 
drop procedure proc24989;
100
 
drop procedure proc24989_2;
101
 
drop table t1,t2;