CREATE TABLE t1(a CHAR(255),
b CHAR(255),
c CHAR(255),
d CHAR(255),
id INT,
PRIMARY KEY(id)) ENGINE=InnoDB;
create table t2 like t1;
create procedure setcrash(IN i INT)
begin
CASE i
WHEN 1 THEN SET SESSION debug_dbug="d,crash_commit_after_prepare";
WHEN 2 THEN SET SESSION debug_dbug="d,crash_commit_after_log";
WHEN 3 THEN SET SESSION debug_dbug="d,crash_commit_before_unlog";
WHEN 4 THEN SET SESSION debug_dbug="d,crash_commit_after";
WHEN 5 THEN SET SESSION debug_dbug="d,crash_commit_before";
ELSE BEGIN END;
END CASE;
end //
FLUSH TABLES;
INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+9);
INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+8);
INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+7);
INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+6);
INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+5);
INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+4);
INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+3);
INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+2);
INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+1);
INSERT INTO t2(a, b, c, d, id) VALUES ('a', 'b', 'c', 'd', 1+0);
SET binlog_format= mixed;
RESET MASTER;
START TRANSACTION;
insert into t1 select * from t2;
call setcrash(5);
COMMIT;
Got one of the listed errors
SELECT * FROM t1 ORDER BY id;
a	b	c	d	id
SHOW BINLOG EVENTS LIMIT 4,1;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
delete from t1;
SET binlog_format= mixed;
RESET MASTER;
START TRANSACTION;
insert into t1 select * from t2;
call setcrash(4);
COMMIT;
Got one of the listed errors
SELECT * FROM t1 ORDER BY id;
a	b	c	d	id
a	b	c	d	1
a	b	c	d	2
a	b	c	d	3
a	b	c	d	4
a	b	c	d	5
a	b	c	d	6
a	b	c	d	7
a	b	c	d	8
a	b	c	d	9
a	b	c	d	10
SHOW BINLOG EVENTS LIMIT 4,1;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Query	1	#	use `test`; insert into t1 select * from t2
delete from t1;
SET binlog_format= mixed;
RESET MASTER;
START TRANSACTION;
insert into t1 select * from t2;
call setcrash(3);
COMMIT;
Got one of the listed errors
SELECT * FROM t1 ORDER BY id;
a	b	c	d	id
a	b	c	d	1
a	b	c	d	2
a	b	c	d	3
a	b	c	d	4
a	b	c	d	5
a	b	c	d	6
a	b	c	d	7
a	b	c	d	8
a	b	c	d	9
a	b	c	d	10
SHOW BINLOG EVENTS LIMIT 4,1;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Query	1	#	use `test`; insert into t1 select * from t2
delete from t1;
SET binlog_format= mixed;
RESET MASTER;
START TRANSACTION;
insert into t1 select * from t2;
call setcrash(2);
COMMIT;
Got one of the listed errors
SELECT * FROM t1 ORDER BY id;
a	b	c	d	id
a	b	c	d	1
a	b	c	d	2
a	b	c	d	3
a	b	c	d	4
a	b	c	d	5
a	b	c	d	6
a	b	c	d	7
a	b	c	d	8
a	b	c	d	9
a	b	c	d	10
SHOW BINLOG EVENTS LIMIT 4,1;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Query	1	#	use `test`; insert into t1 select * from t2
delete from t1;
SET binlog_format= mixed;
RESET MASTER;
START TRANSACTION;
insert into t1 select * from t2;
call setcrash(1);
COMMIT;
Got one of the listed errors
SELECT * FROM t1 ORDER BY id;
a	b	c	d	id
SHOW BINLOG EVENTS LIMIT 4,1;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
delete from t1;
DROP TABLE t1;
DROP TABLE t2;
DROP PROCEDURE setcrash;
