List:Commits« Previous MessageNext Message »
From:Alexey Botchkov Date:October 15 2009 8:02am
Subject:bzr commit into mysql-pe branch (holyfoot:3661) Bug#43854
View as plain text  
#At file:///home/hf/work/mysql_common/43854/ based on revid:jorgen.loland@stripped

 3661 Alexey Botchkov	2009-10-15
      Bug#43854      CHECK TABLE on corrupt archive table returns "OK"
          archive_write counter can be empty at this stage. So fixed by using
          rows_recorded counter.
      
      per-file messages:
        mysql-test/r/archive.result
      Bug#43854      CHECK TABLE on corrupt archive table returns "OK"
          result updated
        mysql-test/t/archive.test
      Bug#43854      CHECK TABLE on corrupt archive table returns "OK"
          testcase added
        storage/archive/ha_archive.cc
      Bug#43854      CHECK TABLE on corrupt archive table returns "OK"
          use rows_recorded counter instead

    added:
      mysql-test/std_data/bug43854.ARZ
      mysql-test/std_data/bug43854.frm
    modified:
      mysql-test/r/archive.result
      mysql-test/t/archive.test
      storage/archive/ha_archive.cc
=== modified file 'mysql-test/r/archive.result'
--- a/mysql-test/r/archive.result	2009-09-10 07:13:39 +0000
+++ b/mysql-test/r/archive.result	2009-10-15 08:00:03 +0000
@@ -12731,3 +12731,12 @@ id	id	name	name
 1	1	a	b
 2	2	a	b
 DROP TABLE t1,t2;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `id` int(11) DEFAULT NULL
+) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
+CHECK TABLE t1;
+Table	Op	Msg_type	Msg_text
+test.t1	check	error	Corrupt
+DROP TABLE t1;

=== added file 'mysql-test/std_data/bug43854.ARZ'
Binary files a/mysql-test/std_data/bug43854.ARZ	1970-01-01 00:00:00 +0000 and b/mysql-test/std_data/bug43854.ARZ	2009-10-15 08:00:03 +0000 differ

=== added file 'mysql-test/std_data/bug43854.frm'
Binary files a/mysql-test/std_data/bug43854.frm	1970-01-01 00:00:00 +0000 and b/mysql-test/std_data/bug43854.frm	2009-10-15 08:00:03 +0000 differ

=== modified file 'mysql-test/t/archive.test'
--- a/mysql-test/t/archive.test	2009-09-10 07:13:39 +0000
+++ b/mysql-test/t/archive.test	2009-10-15 08:00:03 +0000
@@ -1637,3 +1637,14 @@ CREATE TABLE t2(id INT NOT NULL AUTO_INC
 INSERT INTO t2 VALUES(NULL,'b'),(NULL,'b');
 SELECT t1.id, t2.id, t1.name, t2.name FROM t1,t2 WHERE t1.id = t2.id;
 DROP TABLE t1,t2;
+
+#
+# Bug #43854     CHECK TABLE on corrupt archive table returns "OK"
+#
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+copy_file std_data/bug43854.frm $MYSQLD_DATADIR/test/t1.frm;
+copy_file std_data/bug43854.ARZ $MYSQLD_DATADIR/test/t1.ARZ;
+show create table t1;
+CHECK TABLE t1;
+DROP TABLE t1;

=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc	2009-09-23 15:02:56 +0000
+++ b/storage/archive/ha_archive.cc	2009-10-15 08:00:03 +0000
@@ -1508,7 +1508,7 @@ int ha_archive::check(THD* thd, HA_CHECK
   init_archive_reader();
   azflush(&archive, Z_SYNC_FLUSH);
   read_data_header(&archive);
-  for (x= 0; x < share->archive_write.rows; x++)
+  for (x= 0; x < share->rows_recorded; x++)
   {
     rc= get_row(&archive, table->record[0]);
 


Attachment: [text/bzr-bundle] bzr/holyfoot@mysql.com-20091015080003-oz6pekgaafa5ocvj.bundle
Thread
bzr commit into mysql-pe branch (holyfoot:3661) Bug#43854Alexey Botchkov15 Oct