List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:September 28 2006 9:00pm
Subject:bk commit into 5.0 tree (svoj:1.2283)
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, 2006-09-29 00:00:27+05:00, svoj@stripped +4 -0
  Merge mysql.com:/home/svoj/devel/mysql/BUG21617/mysql-4.1-engines
  into  mysql.com:/home/svoj/devel/mysql/BUG21617/mysql-5.0-engines
  MERGE: 1.1616.2144.199

  myisammrg/myrg_open.c@stripped, 2006-09-28 23:56:59+05:00, svoj@stripped +0 -0
    Auto merged
    MERGE: 1.29.1.3

  myisammrg/myrg_queue.c@stripped, 2006-09-28 23:56:59+05:00, svoj@stripped +0 -0
    Auto merged
    MERGE: 1.11.1.1

  mysql-test/r/merge.result@stripped, 2006-09-29 00:00:25+05:00, svoj@stripped +6 -6
    Manual merge.
    MERGE: 1.32.1.10

  mysql-test/t/merge.test@stripped, 2006-09-28 23:56:59+05:00, svoj@stripped +0 -1
    Auto merged
    MERGE: 1.28.1.12

# 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/BUG21617/mysql-5.0-engines/RESYNC

--- 1.32/myisammrg/myrg_open.c	2006-09-29 00:00:31 +05:00
+++ 1.33/myisammrg/myrg_open.c	2006-09-29 00:00:31 +05:00
@@ -33,7 +33,7 @@
 MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
 {
   int save_errno,errpos=0;
-  uint files=0,i,dir_length,length,key_parts;
+  uint files= 0, i, dir_length, length, key_parts, min_keys= 0;
   ulonglong file_offset=0;
   char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end;
   MYRG_INFO *m_info=0;
@@ -109,6 +109,7 @@ MYRG_INFO *myrg_open(const char *name, i
         files= 0;
       }
       m_info->reclength=isam->s->base.reclength;
+      min_keys= isam->s->base.keys;
       errpos=3;
     }
     m_info->open_tables[files].table= isam;
@@ -124,6 +125,8 @@ MYRG_INFO *myrg_open(const char *name, i
     m_info->records+= isam->state->records;
     m_info->del+= isam->state->del;
     m_info->data_file_length+= isam->state->data_file_length;
+    if (min_keys > isam->s->base.keys)
+      min_keys= isam->s->base.keys;
     for (i=0; i < key_parts; i++)
       m_info->rec_per_key_part[i]+= (isam->s->state.rec_per_key_part[i] /
                                      m_info->tables);
@@ -141,7 +144,7 @@ MYRG_INFO *myrg_open(const char *name, i
     my_errno=HA_ERR_RECORD_FILE_FULL;
     goto err;
   }
-  m_info->keys= files ? isam->s->base.keys : 0;
+  m_info->keys= min_keys;
   bzero((char*) &m_info->by_key,sizeof(m_info->by_key));
 
   /* this works ok if the table list is empty */

--- 1.52/mysql-test/r/merge.result	2006-09-29 00:00:31 +05:00
+++ 1.53/mysql-test/r/merge.result	2006-09-29 00:00:31 +05:00
@@ -768,6 +768,12 @@ Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 test.t2	check	status	OK
 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);
+SELECT * FROM t2 WHERE a=2;
+ERROR HY000: Got error 124 from storage engine
+DROP TABLE t1, t2;
 CREATE TABLE t1(a INT) ENGINE=MEMORY;
 CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t1);
 SELECT * FROM t2;

--- 1.44/mysql-test/t/merge.test	2006-09-29 00:00:31 +05:00
+++ 1.45/mysql-test/t/merge.test	2006-09-29 00:00:31 +05:00
@@ -379,6 +379,17 @@ check table t1, t2;
 drop table t1, t2, t3;
 
 #
+# BUG#21617 - crash when selecting from merge table with inconsistent
+# indexes
+#
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES(2),(1);
+CREATE TABLE t2(a INT, KEY(a)) ENGINE=MERGE UNION=(t1);
+--error 1030
+SELECT * FROM t2 WHERE a=2;
+DROP TABLE t1, t2;
+
+#
 # BUG#10974 - No error message if merge table based on union of innodb,
 # memory
 #

--- 1.12/myisammrg/myrg_queue.c	2006-09-29 00:00:31 +05:00
+++ 1.13/myisammrg/myrg_queue.c	2006-09-29 00:00:31 +05:00
@@ -65,6 +65,8 @@ int _myrg_init_queue(MYRG_INFO *info,int
 	error=my_errno;
     }
   }
+  else
+    my_errno= error= HA_ERR_WRONG_INDEX;
   return error;
 }
 
Thread
bk commit into 5.0 tree (svoj:1.2283)Sergey Vojtovich28 Sep