summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/myisam_debug.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/myisam_debug.result')
-rw-r--r--mysql-test/main/myisam_debug.result47
1 files changed, 47 insertions, 0 deletions
diff --git a/mysql-test/main/myisam_debug.result b/mysql-test/main/myisam_debug.result
new file mode 100644
index 00000000..10208a93
--- /dev/null
+++ b/mysql-test/main/myisam_debug.result
@@ -0,0 +1,47 @@
+#
+# BUG#40827 - Killing insert-select to MyISAM can cause table corruption
+#
+CONNECT insertConn, localhost, root,,;
+CREATE TABLE `t1` (
+`id` BIGINT(20) ,
+`id1` BIGINT(20) AUTO_INCREMENT,
+KEY(id1), KEY(id)
+) ENGINE=MyISAM;
+CREATE TABLE `t2` (
+`id` BIGINT(20) ,
+`id1` BIGINT(20) AUTO_INCREMENT,
+KEY (id1), KEY(id)
+) ENGINE=MyISAM;
+INSERT INTO t2 (id) VALUES (123);
+connection insertConn;
+SET SESSION debug_dbug='+d,wait_in_enable_indexes';
+# Send insert data
+INSERT INTO t1(id) SELECT id FROM t2;
+connection default;
+# Wait for insert data to reach the debug point
+SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE STATE = 'wait_in_enable_indexes' AND
+INFO = "INSERT INTO t1(id) SELECT id FROM t2"
+INTO @thread_id;
+Warnings:
+Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
+KILL QUERY @thread_id;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1,t2;
+disconnect insertConn;
+call mtr.add_suppression("Index for table '.*test.t1\\.MYI' is corrupt; try to repair it");
+create table t1 (a int, index(a));
+lock tables t1 write;
+insert t1 values (1),(2),(1);
+set @old_dbug=@@debug_dbug;
+SET debug_dbug='+d,mi_lock_database_failure';
+unlock tables;
+ERROR HY000: Index for table './test/t1.MYI' is corrupt; try to repair it
+SHOW WARNINGS;
+Level Code Message
+Error 126 Index for table './test/t1.MYI' is corrupt; try to repair it
+Error 1030 Got error 22 "Invalid argument" from storage engine MyISAM
+SET debug_dbug=@old_dbug;
+drop table t1;