summaryrefslogtreecommitdiff
path: root/mysql-test/r/myisam.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/myisam.result')
-rw-r--r--mysql-test/r/myisam.result33
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index e1b0683409a..e366c5d1110 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -2415,3 +2415,36 @@ DROP TABLE t1;
SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
SET myisam_repair_threads=@@global.myisam_repair_threads;
End of 5.1 tests
+#
+# Bug#51327 MyISAM table is automatically repaired on ALTER
+# even if myisam-recover is OFF
+#
+call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:");
+call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table");
+call mtr.add_suppression(" '\..test.t1'");
+# Test that we can exchange a crashed partition with a table
+SELECT @@global.myisam_recover_options;
+@@global.myisam_recover_options
+OFF
+CREATE TABLE t1 (a INT, KEY (a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1), (2);
+FLUSH TABLES;
+# replacing t.MYI with a corrupt + unclosed one created by doing:
+# 'create table t1 (a int key(a))' head -c1024 t1.MYI > corrupt_t1.MYI
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check warning 1 client is using or hasn't closed the table properly
+test.t1 check error Size of indexfile is: 1024 Should be: 2048
+test.t1 check warning Size of datafile is: 14 Should be: 7
+test.t1 check error Corrupt
+# Alter table should report error and not auto-repair the table.
+ALTER TABLE t1 ENGINE = MyISAM;
+ERROR HY000: Table 't1' is marked as crashed and should be repaired
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check warning Table is marked as crashed
+test.t1 check warning 1 client is using or hasn't closed the table properly
+test.t1 check error Size of indexfile is: 1024 Should be: 2048
+test.t1 check warning Size of datafile is: 14 Should be: 7
+test.t1 check error Corrupt
+DROP TABLE t1;