From: Date: February 25 2009 3:09pm Subject: bzr commit into mysql-5.1-bugteam branch (satya.bn:2820) Bug#32880 List-Archive: http://lists.mysql.com/commits/67551 X-Bug: 32880 Message-Id: <0KFM00AXRKO9NB30@mail-apac.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT #At file:///home/satya/WORK/mysql-5.1-bugteam-32880/ based on revid:davi.arnaut@stripped 2820 Satya B 2009-02-25 Fix for BUG#32880 - Repairing Archive table fails with internal error 144 Repairing Archive table fails as the row read from the corrupted archive table is not equal the length at the time of insert The assertion is not valid anymore and removed it to avoid the server crash Corrupted Archive tables cannot be repaired. added: mysql-test/std_data/bug32880.ARN mysql-test/std_data/bug32880.ARZ mysql-test/std_data/bug32880.frm modified: mysql-test/r/archive.result mysql-test/t/archive.test storage/archive/ha_archive.cc per-file messages: mysql-test/r/archive.result modified result file for the repair table operation mysql-test/std_data/bug32880.ARN corrupted table to test check and repair table operation mysql-test/std_data/bug32880.ARZ corrupted table to test check and repair table operation mysql-test/std_data/bug32880.frm corrupted table to test check and repair table operation mysql-test/t/archive.test test to check if corrupted archive table fails with error storage/archive/ha_archive.cc Fixed unpack_row() to remove the assertion === modified file 'mysql-test/r/archive.result' --- a/mysql-test/r/archive.result 2008-03-14 16:59:03 +0000 +++ b/mysql-test/r/archive.result 2009-02-25 14:09:38 +0000 @@ -12695,3 +12695,16 @@ a b 1 NULL 2 NULL DROP TABLE t1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` blob +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check error Corrupt +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair error Unknown - internal error 144 during operation +DROP TABLE t1; === added file 'mysql-test/std_data/bug32880.ARN' Binary files a/mysql-test/std_data/bug32880.ARN 1970-01-01 00:00:00 +0000 and b/mysql-test/std_data/bug32880.ARN 2009-02-25 14:09:38 +0000 differ === added file 'mysql-test/std_data/bug32880.ARZ' Binary files a/mysql-test/std_data/bug32880.ARZ 1970-01-01 00:00:00 +0000 and b/mysql-test/std_data/bug32880.ARZ 2009-02-25 14:09:38 +0000 differ === added file 'mysql-test/std_data/bug32880.frm' Binary files a/mysql-test/std_data/bug32880.frm 1970-01-01 00:00:00 +0000 and b/mysql-test/std_data/bug32880.frm 2009-02-25 14:09:38 +0000 differ === modified file 'mysql-test/t/archive.test' --- a/mysql-test/t/archive.test 2008-03-14 16:59:03 +0000 +++ b/mysql-test/t/archive.test 2009-02-25 14:09:38 +0000 @@ -1599,3 +1599,20 @@ INSERT INTO t1 VALUES (NULL, NULL),(NULL FLUSH TABLE t1; SELECT * FROM t1 ORDER BY a; DROP TABLE t1; + +# +# BUG#32880 - Repairing Archive table fails with internal error 144 +# + +# Test with an existing table which is corrupted +let $MYSQLD_DATADIR= `select @@datadir`; +copy_file std_data/bug32880.frm $MYSQLD_DATADIR/test/t1.frm; +chmod 0777 $MYSQLD_DATADIR/test/t1.frm; +copy_file std_data/bug32880.ARZ $MYSQLD_DATADIR/test/t1.ARZ; +chmod 0777 $MYSQLD_DATADIR/test/t1.ARZ; +copy_file std_data/bug32880.ARN $MYSQLD_DATADIR/test/t1.ARN; +chmod 0777 $MYSQLD_DATADIR/test/t1.ARN; +show create table t1; +CHECK TABLE t1; +REPAIR TABLE t1; +DROP TABLE t1; === modified file 'storage/archive/ha_archive.cc' --- a/storage/archive/ha_archive.cc 2008-10-03 18:08:40 +0000 +++ b/storage/archive/ha_archive.cc 2009-02-25 14:09:38 +0000 @@ -1076,8 +1076,6 @@ int ha_archive::unpack_row(azio_stream * read= azread(file_to_read, record_buffer->buffer, row_len, &error); - DBUG_ASSERT(row_len == read); - if (read != row_len || error) { DBUG_RETURN(-1);