Description:
REPAIR table seems not to update checksum of the table, which lead to table corruption
reported by CHECK TABLE followed repair table:
How to repeat:
create table crash(i int) checksum=1;
insert into crash values(1);
Now lets crash table by doing the following on console:
echo . > crash.MYD
mysql> check table crash;
+------------+-------+----------+---------------------------------------------+
| Table | Op | Msg_type | Msg_text |
+------------+-------+----------+---------------------------------------------+
| test.crash | check | error | Size of datafile is: 2 Should be: 6 |
| test.crash | check | error | Corrupt |
+------------+-------+----------+---------------------------------------------+
2 rows in set (0.25 sec)
mysql> repair table crash;
+------------+--------+----------+------------------------------------+
| Table | Op | Msg_type | Msg_text |
+------------+--------+----------+------------------------------------+
| test.crash | repair | warning | Number of rows changed from 1 to 0 |
| test.crash | repair | status | OK |
+------------+--------+----------+------------------------------------+
2 rows in set (0.32 sec)
mysql> check table crash;
+------------+-------+----------+-----------------------------------------------------------------------+
| Table | Op | Msg_type | Msg_text
|
+------------+-------+----------+-----------------------------------------------------------------------+
| test.crash | check | warning | Record checksum is not the same as checksum stored in
the index file
|
| test.crash | check | error | Corrupt
|
+------------+-------+----------+-----------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql>
Description: REPAIR table seems not to update checksum of the table, which lead to table corruption reported by CHECK TABLE followed repair table: How to repeat: create table crash(i int) checksum=1; insert into crash values(1); Now lets crash table by doing the following on console: echo . > crash.MYD mysql> check table crash; +------------+-------+----------+---------------------------------------------+ | Table | Op | Msg_type | Msg_text | +------------+-------+----------+---------------------------------------------+ | test.crash | check | error | Size of datafile is: 2 Should be: 6 | | test.crash | check | error | Corrupt | +------------+-------+----------+---------------------------------------------+ 2 rows in set (0.25 sec) mysql> repair table crash; +------------+--------+----------+------------------------------------+ | Table | Op | Msg_type | Msg_text | +------------+--------+----------+------------------------------------+ | test.crash | repair | warning | Number of rows changed from 1 to 0 | | test.crash | repair | status | OK | +------------+--------+----------+------------------------------------+ 2 rows in set (0.32 sec) mysql> check table crash; +------------+-------+----------+-----------------------------------------------------------------------+ | Table | Op | Msg_type | Msg_text | +------------+-------+----------+-----------------------------------------------------------------------+ | test.crash | check | warning | Record checksum is not the same as checksum stored in the index file | | test.crash | check | error | Corrupt | +------------+-------+----------+-----------------------------------------------------------------------+ 2 rows in set (0.00 sec) mysql>