From 91f0212c68662f57d922e61ce3f5a5defd697949 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 12 Feb 2010 16:33:03 +0400 Subject: BUG#48757 - missing .ARZ file causes server crash Server crashes when accessing ARCHIVE table with missing .ARZ file. When opening a table, ARCHIVE didn't properly pass through error code from lower level azopen() to higher level open() method. mysql-test/r/archive.result: A test case for BUG#48757. mysql-test/t/archive.test: A test case for BUG#48757. storage/archive/ha_archive.cc: Pass through error code from azopen(). --- mysql-test/t/archive.test | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'mysql-test/t/archive.test') diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index 90f5b1b0b53..67ad0517ed2 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1644,3 +1644,14 @@ INSERT INTO t1 (col1, col2) VALUES (1, "value"); REPAIR TABLE t1; DROP TABLE t1; remove_file $MYSQLD_DATADIR/test/t1.ARM; + +--echo # +--echo # BUG#48757 - missing .ARZ file causes server crash +--echo # +CREATE TABLE t1(a INT) ENGINE=ARCHIVE; +FLUSH TABLE t1; +--remove_file $MYSQLD_DATADIR/test/t1.ARZ +--error ER_FILE_NOT_FOUND +SELECT * FROM t1; +--error ER_BAD_TABLE_ERROR +DROP TABLE t1; -- cgit v1.2.1 From 298c067eeede9e086252390856c990633fe08231 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 25 Mar 2010 23:57:06 +0400 Subject: BUG#46565 - repair of partition fail for archive engine There was no way to repair corrupt ARCHIVE data file, when unrecoverable data loss is inevitable. With this fix REPAIR ... EXTENDED attempts to restore as much rows as possible, ignoring unrecoverable data. Normal REPAIR is still able to repair meta-data file only. mysql-test/r/archive.result: A test case for BUG#46565. mysql-test/std_data/bug46565.ARZ: A test case for BUG#46565. mysql-test/std_data/bug46565.frm: A test case for BUG#46565. mysql-test/t/archive.test: A test case for BUG#46565. storage/archive/ha_archive.cc: Allow unrecoverable data loss when extended repair is requested. --- mysql-test/t/archive.test | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'mysql-test/t/archive.test') diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index 67ad0517ed2..7084f5f540e 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1655,3 +1655,26 @@ FLUSH TABLE t1; SELECT * FROM t1; --error ER_BAD_TABLE_ERROR DROP TABLE t1; + + +--echo # +--echo # BUG#46565 - repair of partition fail for archive engine +--echo # +--echo # Installing corrupted table files for t1. +# bug46565 was created, filled and damaged as following: +# CREATE TABLE bug46565(a INT) ENGINE=archive; +# INSERT INTO bug46565 VALUES(1); +# FLUSH TABLE bug46565; +# INSERT INTO bug46565 VALUES(2),(3); +# FLUSH TABLE bug46565; +# dd if=bug46565.ARZ of=std_data/bug46565.ARZ bs=1 count=8670 +copy_file std_data/bug46565.frm $MYSQLD_DATADIR/test/t1.frm; +copy_file std_data/bug46565.ARZ $MYSQLD_DATADIR/test/t1.ARZ; +--error ER_CRASHED_ON_USAGE +SELECT * FROM t1; +REPAIR TABLE t1; +--error ER_CRASHED_ON_USAGE +SELECT * FROM t1; +REPAIR TABLE t1 EXTENDED; +SELECT * FROM t1; +DROP TABLE t1; -- cgit v1.2.1