Details
Description
Creating a certain table and populating it with some dummy data, then compressing that table with myisampack, and then issuing a CHECK TABLE command results in corrupting the table (tested in MariaDB 5.5.37).
The same table and data does not get corrupted by CHECK TABLE in MySQL 5.5.37.
Here is a reproducible test case (I pared it down as far as I could for now):
create table `t1` (`id` varchar(15) DEFAULT NULL) ENGINE=MyISAM ROW_FORMAT=FIXED;
insert into t1 values ('aaa'),('bbb'),('ccc'),('ddd'),('eee');
insert into t1 (select * from t1);
insert into t1 (select * from t1);
insert into t1 (select * from t1);
insert into t1 (select * from t1);
..\..\bin\myisampack t1 ..\..\bin\myisamchk -rq t1 ..\..\bin\mysqladmin -uroot -pmysql -P3314 flush-tables
check table t1; # <-- corrupt!
mysql> check table t1; +-----------+-------+----------+-----------------------------------------------------------------------+ | Table | Op | Msg_type | Msg_text | +-----------+-------+----------+-----------------------------------------------------------------------+ | packed.t1 | check | warning | Record checksum is not the same as checksum stored in the index file | | packed.t1 | check | error | Corrupt | +-----------+-------+----------+-----------------------------------------------------------------------+ mysql> check table t1; +-----------+-------+----------+-----------------------------------------------------------------------+ | Table | Op | Msg_type | Msg_text | +-----------+-------+----------+-----------------------------------------------------------------------+ | packed.t1 | check | warning | Table is marked as crashed | | packed.t1 | check | warning | Record checksum is not the same as checksum stored in the index file | | packed.t1 | check | error | Corrupt | +-----------+-------+----------+-----------------------------------------------------------------------+
I suspect the varchar and the row_format=fixed are involved somehow.
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
I can reproduce it on the top of 5.5 tree (revno 4189), but only on a non-debug build (I built with cmake . && make).
MTR test case:
create table `t1` (`id` varchar(15) DEFAULT NULL) ENGINE=MyISAM ROW_FORMAT=FIXED; insert into t1 values ('aaa'),('bbb'),('ccc'),('ddd'),('eee'); insert into t1 (select * from t1); insert into t1 (select * from t1); insert into t1 (select * from t1); insert into t1 (select * from t1); FLUSH TABLES; let $MYSQLD_DATADIR= `select @@datadir`; --disable_abort_on_error --exec $MYISAMPACK $MYSQLD_DATADIR/test/t1 --exec $MYISAMCHK -rq $MYSQLD_DATADIR/test/t1 --exec $MYSQLADMIN flush-tables --enable_abort_on_error CHECK TABLE t1;Please note that disable/enable abort can be removed, but then the test case will fail not on CHECK TABLE, but on myisamchk.