1CREATE TABLE t1(a CHAR(255),
2b CHAR(255),
3c CHAR(255),
4d CHAR(255),
5id INT AUTO_INCREMENT,
6PRIMARY KEY(id));
7create table t2 like t1;
8create procedure setcrash(IN i INT)
9begin
10CASE i
11WHEN 1 THEN SET SESSION debug="d,crash_commit_after_prepare";
12WHEN 2 THEN SET SESSION debug="d,crash_commit_after_prepare";
13WHEN 3 THEN SET SESSION debug="d,crash_commit_after_prepare";
14WHEN 4 THEN SET SESSION debug="d,crash_commit_after_prepare";
15WHEN 2 THEN SET SESSION debug="d,crash_commit_after_log";
16WHEN 3 THEN SET SESSION debug="d,crash_before_writing_xid";
17WHEN 4 THEN SET SESSION debug="d,crash_commit_after";
18WHEN 5 THEN SET SESSION debug="d,crash_commit_before";
19ELSE BEGIN END;
20END CASE;
21end //
22FLUSH TABLES;
23INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd');
24INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd');
25INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd');
26INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd');
27INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd');
28INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd');
29INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd');
30INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd');
31INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd');
32INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd');
33RESET MASTER;
34START TRANSACTION;
35insert into t1 select * from t2;
36call setcrash(5);
37COMMIT;
38Got one of the listed errors
39SELECT * FROM t1 ORDER BY id;
40a	b	c	d	id
41SHOW BINLOG EVENTS LIMIT 2,1;
42Log_name	Pos	Event_type	Server_id	End_log_pos	Info
43delete from t1;
44RESET MASTER;
45START TRANSACTION;
46insert into t1 select * from t2;
47call setcrash(4);
48COMMIT;
49Got one of the listed errors
50SELECT * FROM t1 ORDER BY id;
51a	b	c	d	id
52SHOW BINLOG EVENTS LIMIT 2,1;
53Log_name	Pos	Event_type	Server_id	End_log_pos	Info
54delete from t1;
55RESET MASTER;
56START TRANSACTION;
57insert into t1 select * from t2;
58call setcrash(3);
59COMMIT;
60Got one of the listed errors
61SELECT * FROM t1 ORDER BY id;
62a	b	c	d	id
63SHOW BINLOG EVENTS LIMIT 2,1;
64Log_name	Pos	Event_type	Server_id	End_log_pos	Info
65delete from t1;
66RESET MASTER;
67START TRANSACTION;
68insert into t1 select * from t2;
69call setcrash(2);
70COMMIT;
71Got one of the listed errors
72SELECT * FROM t1 ORDER BY id;
73a	b	c	d	id
74SHOW BINLOG EVENTS LIMIT 2,1;
75Log_name	Pos	Event_type	Server_id	End_log_pos	Info
76delete from t1;
77RESET MASTER;
78START TRANSACTION;
79insert into t1 select * from t2;
80call setcrash(1);
81COMMIT;
82Got one of the listed errors
83SELECT * FROM t1 ORDER BY id;
84a	b	c	d	id
85SHOW BINLOG EVENTS LIMIT 2,1;
86Log_name	Pos	Event_type	Server_id	End_log_pos	Info
87delete from t1;
88DROP TABLE t1;
89DROP TABLE t2;
90DROP PROCEDURE setcrash;
91