List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:June 27 2007 8:19am
Subject:bk commit into 5.0 tree (svoj:1.2493) BUG#29207
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of svoj. When svoj does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-06-27 13:19:34+05:00, svoj@stripped +3 -0
  BUG#29207 - archive table reported as corrupt by check table (P1)
  
  CHECK TABLE against ARCHIVE table may falsely report table corruption,
  or cause server crash.
  
  Fixed by using proper buffer for CHECK TABLE.
  
  Affects both 5.0 and 5.1.

  mysql-test/r/archive.result@stripped, 2007-06-27 13:19:32+05:00, svoj@stripped +7 -0
    A test case for BUG#28916.

  mysql-test/t/archive.test@stripped, 2007-06-27 13:19:32+05:00, svoj@stripped +9 -0
    A test case for BUG#28916.

  sql/ha_archive.cc@stripped, 2007-06-27 13:19:32+05:00, svoj@stripped +3 -16
    We call Field::get_length() from get_row(). Field::get_length() assumes
    that the row was read into table->record[0] buffer, which is not the
    case when we check a table. As a result we get wrongly initialized
    blob length.
    
    Use table->record[0] as record buffer for check table instead.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	svoj
# Host:	june.mysql.com
# Root:	/home/svoj/devel/mysql/BUG29250/mysql-5.0-engines

--- 1.17/mysql-test/r/archive.result	2007-03-30 13:00:19 +05:00
+++ 1.18/mysql-test/r/archive.result	2007-06-27 13:19:32 +05:00
@@ -12364,3 +12364,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;

--- 1.18/mysql-test/t/archive.test	2007-03-30 13:00:20 +05:00
+++ 1.19/mysql-test/t/archive.test	2007-06-27 13:19:32 +05:00
@@ -1374,3 +1374,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;

--- 1.86/sql/ha_archive.cc	2007-06-24 19:44:51 +05:00
+++ 1.87/sql/ha_archive.cc	2007-06-27 13:19:32 +05:00
@@ -1205,7 +1205,6 @@ bool ha_archive::is_crashed() const 
 int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt)
 {
   int rc= 0;
-  byte *buf; 
   const char *old_proc_info=thd->proc_info;
   ha_rows count= share->rows_recorded;
   DBUG_ENTER("ha_archive::check");
@@ -1214,25 +1213,13 @@ int ha_archive::check(THD* thd, HA_CHECK
   /* Flush any waiting data */
   gzflush(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= (byte*) 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.
   */
-  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= old_proc_info;
 
Thread
bk commit into 5.0 tree (svoj:1.2493) BUG#29207Sergey Vojtovich27 Jun