| 1 |
call mtr.add_suppression("..test.t1_will_crash"); |
| 2 |
call mtr.add_suppression("Got an error from unknown thread"); |
| 3 |
call mtr.add_suppression("Table 't1_will_crash' is marked as crashed and should be repaired"); |
| 4 |
CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM; |
| 5 |
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11); |
| 6 |
FLUSH TABLES; |
| 7 |
# replacing t1.MYI with a corrupt + unclosed one created by doing: |
| 8 |
# 'create table t1 (a int key(a))' head -c1024 t1.MYI > corrupt_t1.MYI |
| 9 |
SELECT * FROM t1_will_crash; |
| 10 |
a |
| 11 |
1 |
| 12 |
2 |
| 13 |
3 |
| 14 |
4 |
| 15 |
5 |
| 16 |
6 |
| 17 |
7 |
| 18 |
8 |
| 19 |
9 |
| 20 |
10 |
| 21 |
11 |
| 22 |
Warnings: |
| 23 |
Error 145 Table 't1_will_crash' is marked as crashed and should be repaired |
| 24 |
Warning 1034 1 client is using or hasn't closed the table properly |
| 25 |
Error 1034 Size of indexfile is: 1024 Should be: 2048 |
| 26 |
Warning 1034 Size of datafile is: 77 Should be: 7 |
| 27 |
Warning 1034 Number of rows changed from 1 to 11 |
| 28 |
DROP TABLE t1_will_crash; |
| 29 |
CREATE TABLE t1_will_crash (a INT, KEY (a)) |
| 30 |
ENGINE=MyISAM |
| 31 |
PARTITION BY HASH(a) |
| 32 |
PARTITIONS 3; |
| 33 |
INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11); |
| 34 |
FLUSH TABLES; |
| 35 |
# replacing t1#P#p1.MYI with a corrupt + unclosed one created by doing: |
| 36 |
# 'create table t1 (a int key(a)) partition by hash (a) partitions 3' |
| 37 |
# head -c1024 t1#P#p1.MYI > corrupt_t1#P#p1.MYI |
| 38 |
SELECT * FROM t1_will_crash; |
| 39 |
a |
| 40 |
1 |
| 41 |
2 |
| 42 |
3 |
| 43 |
4 |
| 44 |
5 |
| 45 |
6 |
| 46 |
7 |
| 47 |
8 |
| 48 |
9 |
| 49 |
10 |
| 50 |
11 |
| 51 |
Warnings: |
| 52 |
Error 145 Table 't1_will_crash#P#p1' is marked as crashed and should be repaired |
| 53 |
Warning 1034 1 client is using or hasn't closed the table properly |
| 54 |
Error 1034 Size of indexfile is: 1024 Should be: 2048 |
| 55 |
Warning 1034 Size of datafile is: 28 Should be: 7 |
| 56 |
Warning 1034 Number of rows changed from 1 to 4 |
| 57 |
DROP TABLE t1_will_crash; |