Commit 0cb2099c authored by svoj@june.mysql.com's avatar svoj@june.mysql.com

Merge mysql.com:/home/svoj/devel/mysql/BUG29250/mysql-5.0-engines

into  mysql.com:/home/svoj/devel/mysql/BUG29250/mysql-5.1-engines
parents c8717280 6d4033e6
......@@ -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;
......@@ -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,28 +1556,15 @@ 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)))
while (!(rc= get_row(&archive, table->record[0])))
count--;
my_free((char*)buf, MYF(0));
thd_proc_info(thd, old_proc_info);
if ((rc && rc != HA_ERR_END_OF_FILE) || count)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment