1
--source include/have_debug.inc
3
# We disable this test in embedded mode because of BUG#43733
4
--source include/not_embedded.inc
7
--echo # BUG#40827 - Killing insert-select to MyISAM can cause table corruption
10
CONNECT (insertConn, localhost, root,,);
14
`id1` BIGINT(20) AUTO_INCREMENT,
20
`id1` BIGINT(20) AUTO_INCREMENT,
24
INSERT INTO t2 (id) VALUES (123);
29
INSERT INTO t2 (id) SELECT id FROM t2;
33
--echo # Switch to insert Connection
34
CONNECTION insertConn;
35
SET SESSION debug='+d,wait_in_enable_indexes';
36
--echo # Send insert data
37
SEND INSERT INTO t1(id) SELECT id FROM t2;
39
--echo # Switch to default Connection
41
--echo # Wait for insert data to reach the debug point
44
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
45
WHERE STATE = "wait_in_enable_indexes" AND
46
INFO = "INSERT INTO t1(id) SELECT id FROM t2";
47
--source include/wait_condition.inc
49
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
50
WHERE STATE = 'wait_in_enable_indexes' AND
51
INFO = "INSERT INTO t1(id) SELECT id FROM t2"
54
KILL QUERY @thread_id;
57
DISCONNECT insertConn;