List:Commits« Previous MessageNext Message »
From:Jim Winstead Date:February 16 2006 4:15pm
Subject:bk commit into 5.1 tree (jimw:1.2114) BUG#17169
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jimw. When jimw 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
  1.2114 06/02/16 08:15:36 jimw@stripped +3 -0
  Bug #17169: Partitions: out of memory if add partition and unique.
  When creating a new partition, a bogus memory allocation problem was
  reported.

  sql/sql_table.cc
    1.305 06/02/16 08:15:32 jimw@stripped +9 -14
    Fix inverted tests that caused mysql_copy_key_list() to not work at all,
    remove a forward declaration for a function that does not exist, and fix
    a debug message.

  mysql-test/t/partition.test
    1.16 06/02/16 08:15:32 jimw@stripped +7 -0
    Add new regression test

  mysql-test/r/partition.result
    1.15 06/02/16 08:15:32 jimw@stripped +3 -0
    Add new results

# 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:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-5.1-17169

--- 1.304/sql/sql_table.cc	2006-02-12 23:53:43 -08:00
+++ 1.305/sql/sql_table.cc	2006-02-16 08:15:32 -08:00
@@ -50,11 +50,6 @@
                                handler *file, KEY **key_info_buffer,
                                uint *key_count, int select_field_count);
 
-static int mysql_copy_create_lists(List<create_field> *orig_create_list,
-                                   List<Key> *orig_key,
-                                   List<create_field> *new_create_list,
-                                   List<Key> *new_key);
-
 #define MYSQL50_TABLE_NAME_PREFIX         "#mysql50#"
 #define MYSQL50_TABLE_NAME_PREFIX_LENGTH  9
 
@@ -164,8 +159,7 @@
 */
 
 static int mysql_copy_create_list(List<create_field> *orig_create_list,
-
-                                   List<create_field> *new_create_list)
+                                  List<create_field> *new_create_list)
 {
   List_iterator<create_field> prep_field_it(*orig_create_list);
   create_field *prep_field;
@@ -205,7 +199,7 @@
 {
   List_iterator<Key> prep_key_it(*orig_key);
   Key *prep_key;
-  DBUG_ENTER("mysql_copy_create_lists");
+  DBUG_ENTER("mysql_copy_key_list");
 
   while ((prep_key= prep_key_it++))
   {
@@ -217,7 +211,8 @@
     while ((prep_col= prep_col_it++))
     {
       key_part_spec *prep_key_part;
-      if (prep_key_part= new key_part_spec(*prep_col))
+
+      if (!(prep_key_part= new key_part_spec(*prep_col)))
       {
         mem_alloc_error(sizeof(key_part_spec));
         DBUG_RETURN(TRUE);
@@ -228,11 +223,11 @@
         DBUG_RETURN(TRUE);
       }
     }
-    if ((temp_key= new Key(prep_key->type, prep_key->name,
-                           prep_key->algorithm,
-                           prep_key->generated,
-                           prep_columns,
-                           prep_key->parser_name)))
+    if (!(temp_key= new Key(prep_key->type, prep_key->name,
+                            prep_key->algorithm,
+                            prep_key->generated,
+                            prep_columns,
+                            prep_key->parser_name)))
     {
       mem_alloc_error(sizeof(Key));
       DBUG_RETURN(TRUE);

--- 1.14/mysql-test/r/partition.result	2006-02-15 17:01:27 -08:00
+++ 1.15/mysql-test/r/partition.result	2006-02-16 08:15:32 -08:00
@@ -312,4 +312,7 @@
 insert into t1 values (1,1),(2,2);
 replace into t1 values (1,1),(2,2);
 drop table t1;
+create table t1 (s1 int, unique (s1)) partition by list (s1) (partition x1 VALUES in (10), partition x2 values in (20));
+alter table t1 add partition (partition x3 values in (30));
+drop table t1;
 End of 5.1 tests

--- 1.15/mysql-test/t/partition.test	2006-02-15 17:01:27 -08:00
+++ 1.16/mysql-test/t/partition.test	2006-02-16 08:15:32 -08:00
@@ -401,4 +401,11 @@
 replace into t1 values (1,1),(2,2);
 drop table t1;
 
+#
+# Bug #17169: Partitions: out of memory if add partition and unique
+#
+create table t1 (s1 int, unique (s1)) partition by list (s1) (partition x1 VALUES in (10), partition x2 values in (20));
+alter table t1 add partition (partition x3 values in (30));
+drop table t1;
+
 --echo End of 5.1 tests
Thread
bk commit into 5.1 tree (jimw:1.2114) BUG#17169Jim Winstead16 Feb