List:Commits« Previous MessageNext Message »
From:reggie Date:March 3 2006 2:11pm
Subject:bk commit into 5.1 tree (reggie:1.2143)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of reggie. When reggie 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.2143 06/03/03 08:11:44 reggie@stripped +3 -0
  Merge rburnett@stripped:/home/bk/mysql-5.1-new
  into  linux.site:/home/reggie/work/mysql-5.1

  sql/sql_partition.cc
    1.42 06/03/03 08:11:33 reggie@stripped +0 -29
    Auto merged

  mysql-test/t/partition.test
    1.18 06/03/03 08:11:32 reggie@stripped +0 -40
    Auto merged

  mysql-test/r/partition.result
    1.14 06/03/03 08:11:32 reggie@stripped +0 -33
    Auto merged

# 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:	reggie
# Host:	linux.site
# Root:	/home/reggie/work/mysql-5.1/RESYNC

--- 1.13/mysql-test/r/partition.result	2006-02-24 05:56:40 -06:00
+++ 1.14/mysql-test/r/partition.result	2006-03-03 08:11:32 -06:00
@@ -348,4 +348,29 @@
 SELECT * FROM t1 WHERE f_int1  IS NULL;
 f_int1	f_int2	f_char1	f_char2	f_charbig
 drop table t1;
+create procedure p ()
+begin
+create table t1 (s1 mediumint,s2 mediumint)
+partition by list (s2)
+(partition p1 values in (0),
+partition p2 values in (1));
+end//
+call p()//
+drop procedure p//
+drop table t1;
+create procedure p ()
+begin
+create table t1 (a int not null,b int not null,c int not null,primary key (a,b))
+partition by range (a)
+subpartition by hash (a+b)
+(partition x1 values less than (1)
+(subpartition x11,
+subpartition x12),
+partition x2 values less than (5)
+(subpartition x21,
+subpartition x22));
+end//
+call p()//
+drop procedure p//
+drop table t1//
 End of 5.1 tests

--- 1.17/mysql-test/t/partition.test	2006-02-24 05:56:40 -06:00
+++ 1.18/mysql-test/t/partition.test	2006-03-03 08:11:32 -06:00
@@ -448,4 +448,39 @@
 SELECT * FROM t1 WHERE f_int1  IS NULL;
 drop table t1;
 
+#
+# Bug#14363 Partitions: failure if create in stored procedure
+#
+delimiter //;
+
+create procedure p ()
+begin
+create table t1 (s1 mediumint,s2 mediumint)
+partition by list (s2)
+(partition p1 values in (0),
+ partition p2 values in (1));
+end//
+
+call p()//
+drop procedure p//
+drop table t1;
+
+create procedure p ()
+begin
+create table t1 (a int not null,b int not null,c int not null,primary key (a,b))
+partition by range (a)
+subpartition by hash (a+b)
+(partition x1 values less than (1)
+ (subpartition x11,
+  subpartition x12),
+ partition x2 values less than (5)
+ (subpartition x21,
+  subpartition x22));
+end//
+
+call p()//
+drop procedure p//
+drop table t1//
+delimiter ;//
+
 --echo End of 5.1 tests

--- 1.41/sql/sql_partition.cc	2006-02-24 05:56:40 -06:00
+++ 1.42/sql/sql_partition.cc	2006-03-03 08:11:33 -06:00
@@ -697,7 +697,7 @@
     my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));
     goto end;
   }
-  if (same_name= part_info->has_unique_names())
+  if ((same_name= part_info->has_unique_names()))
   {
     my_error(ER_SAME_NAME_PARTITION, MYF(0), same_name);
     goto end;
@@ -1414,6 +1414,7 @@
     DBUG_RETURN(TRUE);
   }
   bitmap_init(&part_info->used_partitions, bitmap_buf, bitmap_bytes*8, FALSE);
+  bitmap_set_all(&part_info->used_partitions);
   DBUG_RETURN(FALSE);
 }
 
@@ -3629,11 +3630,13 @@
   Item *thd_free_list= thd->free_list;
   bool result= TRUE;
   partition_info *part_info;
+  CHARSET_INFO *old_character_set_client= thd->variables.character_set_client;
   LEX *old_lex= thd->lex;
   LEX lex;
   DBUG_ENTER("mysql_unpack_partition");
 
   thd->lex= &lex;
+  thd->variables.character_set_client= system_charset_info;
   lex_start(thd, part_buf, part_info_len);
   /*
     We need to use the current SELECT_LEX since I need to keep the
@@ -3759,6 +3762,7 @@
 end:
   thd->free_list= thd_free_list;
   thd->lex= old_lex;
+  thd->variables.character_set_client= old_character_set_client;
   DBUG_RETURN(result);
 }
 
@@ -4034,7 +4038,7 @@
       is freed by setting version to 0. table->s->version= 0 forces a
       flush of the table object in close_thread_tables().
     */
-    uint flags;
+    uint flags= 0;
     table->s->version= 0L;
     if (alter_info->flags == ALTER_TABLE_REORG)
     {
@@ -4083,7 +4087,10 @@
       my_error(ER_PARTITION_FUNCTION_FAILURE, MYF(0));
       DBUG_RETURN(1);
     }
-    *fast_alter_partition= flags ^ HA_PARTITION_FUNCTION_SUPPORTED;
+    *fast_alter_partition=
+      ((flags & (HA_FAST_CHANGE_PARTITION | HA_PARTITION_ONE_PHASE)) != 0);
+    DBUG_PRINT("info", ("*fast_alter_partition: %d  flags: 0x%x",
+                        *fast_alter_partition, flags));
     if (alter_info->flags & ALTER_ADD_PARTITION)
     {
       /*
@@ -4683,7 +4690,6 @@
       DBUG_ASSERT(FALSE);
     }
     *partition_changed= TRUE;
-    create_info->db_type= &partition_hton;
     thd->lex->part_info= tab_part_info;
     if (alter_info->flags == ALTER_ADD_PARTITION ||
         alter_info->flags == ALTER_REORGANIZE_PARTITION)
Thread
bk commit into 5.1 tree (reggie:1.2143)reggie3 Mar