List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:October 5 2006 1:49pm
Subject:bk commit into 4.1 tree (svoj:1.2556) BUG#22937
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 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, 2006-10-05 16:49:23+05:00, svoj@stripped +3 -0
  BUG#22937 - Valgrind failure in 'merge' test (ha_myisammrg.cc:329)
  
  This is addition to fix for bug21617. Valgrind reports an error when
  opening merge table that has underlying tables with less indexes than
  in a merge table itself.
  
  For each subtable check if number of keys is less than in merge table. Return
  an error and refuse to open merge table in this case.

  mysql-test/r/merge.result@stripped, 2006-10-05 16:49:22+05:00, svoj@stripped +1 -1
    Fixed a test case according to fix for bug#22937.

  mysql-test/t/merge.test@stripped, 2006-10-05 16:49:22+05:00, svoj@stripped +1 -1
    Fixed a test case according to fix for bug#22937.

  sql/ha_myisammrg.cc@stripped, 2006-10-05 16:49:22+05:00, svoj@stripped +9 -1
    For each subtable check if number of keys is less than in merge table. Return
    an error and refuse to open merge table in this case.

# 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:	april.(none)
# Root:	/home/svoj/devel/mysql/BUG22937/mysql-4.1-engines

--- 1.62/sql/ha_myisammrg.cc	2006-10-05 16:49:26 +05:00
+++ 1.63/sql/ha_myisammrg.cc	2006-10-05 16:49:26 +05:00
@@ -50,13 +50,21 @@ const char *ha_myisammrg::index_type(uin
 int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
 {
   char name_buff[FN_REFLEN];
-
+  MYRG_TABLE *subtable;
   DBUG_PRINT("info", ("ha_myisammrg::open"));
   if (!(file=myrg_open(fn_format(name_buff,name,"","",2 | 4), mode,
 		       test_if_locked)))
   {
     DBUG_PRINT("info", ("ha_myisammrg::open exit %d", my_errno));
     return (my_errno ? my_errno : -1);
+  }
+  for (subtable= file->open_tables; subtable < file->end_table; subtable++)
+  {
+    if (subtable->table->s->base.keys < table->keys)
+    {
+      DBUG_PRINT("error", ("Underlying table has less keys than merge table."));
+      goto err;
+    }
   }
   DBUG_PRINT("info", ("ha_myisammrg::open myrg_extrafunc..."))
   myrg_extrafunc(file, query_cache_invalidate_by_MyISAM_filename_ref);

--- 1.42/mysql-test/r/merge.result	2006-10-05 16:49:26 +05:00
+++ 1.43/mysql-test/r/merge.result	2006-10-05 16:49:26 +05:00
@@ -770,7 +770,7 @@ CREATE TABLE t1(a INT);
 INSERT INTO t1 VALUES(2),(1);
 CREATE TABLE t2(a INT, KEY(a)) ENGINE=MERGE UNION=(t1);
 SELECT * FROM t2 WHERE a=2;
-ERROR HY000: Got error 124 from storage engine
+ERROR HY000: Unable to open underlying table which is differently defined or of
non-MyISAM type or doesn't exists
 DROP TABLE t1, t2;
 CREATE TABLE t1(a INT) ENGINE=MEMORY;
 CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t1);

--- 1.40/mysql-test/t/merge.test	2006-10-05 16:49:26 +05:00
+++ 1.41/mysql-test/t/merge.test	2006-10-05 16:49:26 +05:00
@@ -383,7 +383,7 @@ drop table t1, t2, t3;
 CREATE TABLE t1(a INT);
 INSERT INTO t1 VALUES(2),(1);
 CREATE TABLE t2(a INT, KEY(a)) ENGINE=MERGE UNION=(t1);
---error 1030
+--error 1168
 SELECT * FROM t2 WHERE a=2;
 DROP TABLE t1, t2;
 
Thread
bk commit into 4.1 tree (svoj:1.2556) BUG#22937Sergey Vojtovich5 Oct