1RESET MASTER;
2connection default;
3CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, a INT, b INT) ENGINE=INNODB;
4INSERT INTO t1(a, b) VALUES(1,2),(2,4),(3,6),(4,8),(5,10);
5SET DEBUG_SYNC = "open_and_process_table signal truncate_before_lock wait_for forever";
6TRUNCATE t1;
7connect con1,localhost,root,,;
8SET DEBUG_SYNC = "now wait_for truncate_before_lock";
9SELECT ((@id := id) - id) FROM information_schema.processlist WHERE processlist.info LIKE '%TRUNCATE t1%' AND state LIKE '%open_and_process_table%';
10((@id := id) - id)
110
12KILL QUERY @id;
13connection default;
14ERROR 70100: Query execution was interrupted
15connection con1;
16include/show_binlog_events.inc
17connection con1;
18connection con1;
19Log_name	Pos	Event_type	Server_id	End_log_pos	Info
20master-bin.000001	#	Query	#	#	use `test`; CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, a INT, b INT) ENGINE=INNODB
21master-bin.000001	#	Query	#	#	BEGIN
22master-bin.000001	#	Intvar	#	#	INSERT_ID=1
23master-bin.000001	#	Query	#	#	use `test`; INSERT INTO t1(a, b) VALUES(1,2),(2,4),(3,6),(4,8),(5,10)
24master-bin.000001	#	Xid	#	#	COMMIT /* XID */
25connection con1;
26connection con1;
27disconnect con1;
28connection default;
29SELECT * FROM t1;
30id	a	b
311	1	2
322	2	4
333	3	6
344	4	8
355	5	10
36DROP TABLE t1;
37SET DEBUG_SYNC= 'RESET';
38