diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index 59462e848d2674a0b3a2ac7fc769b29b3ecf5f4a..36b013703d88b798c7385921d62c29fb1450b05d 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12675,3 +12675,10 @@ select * from t1; i 1 drop table t1; +create table t1(a longblob) engine=archive; +insert into t1 set a=''; +insert into t1 set a='a'; +check table t1 extended; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index b5ace75dbc4bd8ace2df28ad491cd170c719ca81..23c591856a7ff990f433a44f829054192f731d61 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1550,3 +1550,12 @@ insert into t1 values (1); repair table t1 use_frm; select * from t1; drop table t1; + +# +# BUG#29207 - archive table reported as corrupt by check table +# +create table t1(a longblob) engine=archive; +insert into t1 set a=''; +insert into t1 set a='a'; +check table t1 extended; +drop table t1; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 0c4f3cf708fd8df49fcb32305ba129ea660dfb11..37e42f7a85081e85b671e27a15b1e3a1b305f29f 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3117,7 +3117,7 @@ int ha_partition::rnd_next(uchar *buf) continue; // Probably MyISAM if (result != HA_ERR_END_OF_FILE) - break; // Return error + goto end_dont_reset_start_part; // Return error /* End current partition */ late_extra_no_cache(part_id); @@ -3143,6 +3143,7 @@ int ha_partition::rnd_next(uchar *buf) end: m_part_spec.start_part= NO_CURRENT_PART_ID; +end_dont_reset_start_part: table->status= STATUS_NOT_FOUND; DBUG_RETURN(result); } diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index d1482de18ec7d1ecbf8a4f8a2159f77785dd500b..bdc59cbe7954bb91d9328fcb1fbedd85d28218f3 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -1548,7 +1548,6 @@ bool ha_archive::is_crashed() const int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt) { int rc= 0; - uchar *buf; const char *old_proc_info; ha_rows count= share->rows_recorded; DBUG_ENTER("ha_archive::check"); @@ -1557,27 +1556,14 @@ int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt) /* Flush any waiting data */ azflush(&(share->archive_write), Z_SYNC_FLUSH); - /* - First we create a buffer that we can use for reading rows, and can pass - to get_row(). - */ - if (!(buf= (uchar*) my_malloc(table->s->reclength, MYF(MY_WME)))) - rc= HA_ERR_OUT_OF_MEM; - /* Now we will rewind the archive file so that we are positioned at the start of the file. */ init_archive_reader(); - - if (!rc) - read_data_header(&archive); - - if (!rc) - while (!(rc= get_row(&archive, buf))) - count--; - - my_free((char*)buf, MYF(0)); + read_data_header(&archive); + while (!(rc= get_row(&archive, table->record[0]))) + count--; thd_proc_info(thd, old_proc_info);