List:Commits« Previous MessageNext Message »
From:mikael Date:January 3 2006 3:36pm
Subject:bk commit into 5.1 tree (mikron:1.2015)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mikron. When mikron 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.2015 06/01/03 16:36:00 mikron@stripped +4 -0
  WL #2604: Partition Management
  Review fixes

  sql/sql_partition.cc
    1.27 06/01/03 16:34:51 mikron@stripped +21 -30
    Naming fix
    Bug in what reorganize variants are allowed
    Removed "old" comment
    Some more comment fixes

  sql/sql_lex.h
    1.208 06/01/03 16:34:50 mikron@stripped +25 -25
    Constant fix

  sql/ha_partition.cc
    1.24 06/01/03 16:34:50 mikron@stripped +27 -27
    Removed Z from constants + comment fix

  mysql-test/t/partition.test
    1.12 06/01/03 16:34:50 mikron@stripped +1 -34
    Remove Duplicate + add show create table

# 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:	mikron
# Host:	mikael-ronstr-ms-dator.local
# Root:	/Users/mikron/wl2604

--- 1.207/sql/sql_lex.h	2005-12-30 18:23:20 +01:00
+++ 1.208/sql/sql_lex.h	2006-01-03 16:34:50 +01:00
@@ -659,31 +659,31 @@
 };
 typedef class st_select_lex SELECT_LEX;
 
-#define ALTER_ADD_COLUMN	0x00000001
-#define ALTER_DROP_COLUMN	0x00000002
-#define ALTER_CHANGE_COLUMN	0x00000004
-#define ALTER_ADD_INDEX		0x00000008
-#define ALTER_DROP_INDEX	0x00000010
-#define ALTER_RENAME		0x00000020
-#define ALTER_ORDER		0x00000040
-#define ALTER_OPTIONS		0x00000080
-#define ALTER_CHANGE_COLUMN_DEFAULT 0x00000100
-#define ALTER_KEYS_ONOFF        0x00000200
-#define ALTER_CONVERT           0x00000400
-#define ALTER_FORCE		0x00000800
-#define ALTER_RECREATE          0x00001000
-#define ALTER_ADD_PARTITION     0x00002000
-#define ALTER_DROP_PARTITION    0x00004000
-#define ALTER_COALESCE_PARTITION 0x00008000
-#define ALTER_REORGANIZE_PARTITION 0x00010000 
-#define ALTER_PARTITION          0x00020000
-#define ALTER_OPTIMIZE_PARTITION 0x00040000
-#define ALTER_TABLE_REORG        0x00080000
-#define ALTER_REBUILD_PARTITION  0x00100000
-#define ALTER_ALL_PARTITION      0x00200000
-#define ALTER_ANALYZE_PARTITION  0x00400000
-#define ALTER_CHECK_PARTITION    0x00800000
-#define ALTER_REPAIR_PARTITION   0x01000000
+#define ALTER_ADD_COLUMN	(1L << 0)
+#define ALTER_DROP_COLUMN	(1L << 1)
+#define ALTER_CHANGE_COLUMN	(1L << 2)
+#define ALTER_ADD_INDEX		(1L << 3)
+#define ALTER_DROP_INDEX	(1L << 4)
+#define ALTER_RENAME		(1L << 5)
+#define ALTER_ORDER		(1L << 6)
+#define ALTER_OPTIONS		(1L << 7)
+#define ALTER_CHANGE_COLUMN_DEFAULT (1L << 8)
+#define ALTER_KEYS_ONOFF        (1L << 9)
+#define ALTER_CONVERT           (1L << 10)
+#define ALTER_FORCE		(1L << 11)
+#define ALTER_RECREATE          (1L << 12)
+#define ALTER_ADD_PARTITION     (1L << 13)
+#define ALTER_DROP_PARTITION    (1L << 14)
+#define ALTER_COALESCE_PARTITION (1L << 15)
+#define ALTER_REORGANIZE_PARTITION (1L << 16) 
+#define ALTER_PARTITION          (1L << 17)
+#define ALTER_OPTIMIZE_PARTITION (1L << 18)
+#define ALTER_TABLE_REORG        (1L << 19)
+#define ALTER_REBUILD_PARTITION  (1L << 20)
+#define ALTER_ALL_PARTITION      (1L << 21)
+#define ALTER_ANALYZE_PARTITION  (1L << 22)
+#define ALTER_CHECK_PARTITION    (1L << 23)
+#define ALTER_REPAIR_PARTITION   (1L << 24)
 
 typedef struct st_alter_info
 {

--- 1.11/mysql-test/t/partition.test	2006-01-01 00:54:59 +01:00
+++ 1.12/mysql-test/t/partition.test	2006-01-03 16:34:50 +01:00
@@ -228,6 +228,7 @@
 PARTITIONS 1
 (PARTITION x1 VALUES IN (1) ENGINE=MEMORY);
 
+show create table t1;
 drop table t1;
 
 #
@@ -288,40 +289,6 @@
 
 analyze table t1;
 
-drop table t1;
-
-#
-# Bug 14327: PARTITIONS clause gets lost in SHOW CREATE TABLE
-#
-CREATE TABLE t1 (a int)
-PARTITION BY HASH(a)
-PARTITIONS 5;
-
-SHOW CREATE TABLE t1;
-
-drop table t1;
-
-#
-# Bug #13446: Update to value outside of list values doesn't give error
-#
-CREATE TABLE t1 (a int)
-PARTITION BY RANGE (a)
-(PARTITION x1 VALUES LESS THAN (2));
-
-insert into t1 values (1);
---error ER_NO_PARTITION_FOR_GIVEN_VALUE
-update t1 set a = 5;
-
-drop table t1;
-
-#
-# Bug #13441: Analyze on partitioned table didn't work
-#
-CREATE TABLE t1 (a int)
-PARTITION BY LIST (a)
-(PARTITION x1 VALUES IN (10), PARTITION x2 VALUES IN (20));
-
-analyze table t1;
 drop table t1;
 
 #

--- 1.23/sql/ha_partition.cc	2006-01-01 00:54:59 +01:00
+++ 1.24/sql/ha_partition.cc	2006-01-03 16:34:50 +01:00
@@ -375,17 +375,17 @@
     the del_ren_cre_table method.
 */
 
-#define ZNORMAL_PART_NAME 0
-#define ZTEMP_PART_NAME 1
-#define ZRENAMED_PART_NAME 2
+#define NORMAL_PART_NAME 0
+#define TEMP_PART_NAME 1
+#define RENAMED_PART_NAME 2
 static void create_partition_name(char *out, const char *in1,
                                   const char *in2, uint name_variant)
 {
-  if (name_variant == ZNORMAL_PART_NAME)
+  if (name_variant == NORMAL_PART_NAME)
     strxmov(out, in1, "$$P$$", in2, NullS);
-  else if (name_variant == ZTEMP_PART_NAME)
+  else if (name_variant == TEMP_PART_NAME)
     strxmov(out, in1, "$$P$$", in2, "$$TMP$$", NullS);
-  else if (name_variant == ZRENAMED_PART_NAME)
+  else if (name_variant == RENAMED_PART_NAME)
     strxmov(out, in1, "$$P$$", in2, "$$REN$$", NullS);
 }
 
@@ -412,11 +412,11 @@
                                      const char *in2, const char *in3,
                                      uint name_variant)
 {
-  if (name_variant == ZNORMAL_PART_NAME)
+  if (name_variant == NORMAL_PART_NAME)
     strxmov(out, in1, "$$P$$", in2, "$$SP$$", in3, NullS);
-  else if (name_variant == ZTEMP_PART_NAME)
+  else if (name_variant == TEMP_PART_NAME)
     strxmov(out, in1, "$$P$$", in2, "$$SP$$", in3, "$$TMP$$", NullS);
-  else if (name_variant == ZRENAMED_PART_NAME)
+  else if (name_variant == RENAMED_PART_NAME)
     strxmov(out, in1, "$$P$$", in2, "$$SP$$", in3, "$$REN$$", NullS);
 }
 
@@ -475,7 +475,7 @@
     Renames a table from one name to another from alter table call.
 
     If you do not implement this, the default rename_table() is called from
-    handler.cc and it will delete all files with the file extentions returned
+    handler.cc and it will rename all files with the file extentions returned
     by bas_ext().
 
     Called from sql_table.cc by mysql_rename_table().
@@ -623,10 +623,10 @@
       /*
         This part is to be dropped, meaning the part or all its subparts.
       */
-      name_variant= ZNORMAL_PART_NAME;
+      name_variant= NORMAL_PART_NAME;
       if (part_elem->part_state == PART_IS_CHANGED ||
           (part_elem->part_state == PART_TO_BE_DROPPED && temp_partitions))
-        name_variant= ZRENAMED_PART_NAME;
+        name_variant= RENAMED_PART_NAME;
       if (m_is_sub_partitioned)
       {
         List_iterator<partition_element> sub_it(part_elem->subpartitions);
@@ -718,11 +718,11 @@
           create_subpartition_name(part_name_buff, path,
                                    part_elem->partition_name,
                                    sub_elem->partition_name,
-                                   ZRENAMED_PART_NAME);
+                                   RENAMED_PART_NAME);
           create_subpartition_name(norm_name_buff, path,
                                    part_elem->partition_name,
                                    sub_elem->partition_name,
-                                   ZNORMAL_PART_NAME);
+                                   NORMAL_PART_NAME);
           DBUG_PRINT("info", ("Rename subpartition from %s to %s",
                      norm_name_buff, part_name_buff));
           error= file->rename_table((const char *) norm_name_buff,
@@ -733,9 +733,9 @@
       {
         file= m_reorged_file[part_count++];
         create_partition_name(part_name_buff, path,
-                              part_elem->partition_name, ZRENAMED_PART_NAME);
+                              part_elem->partition_name, RENAMED_PART_NAME);
         create_partition_name(norm_name_buff, path,
-                              part_elem->partition_name, ZNORMAL_PART_NAME);
+                              part_elem->partition_name, NORMAL_PART_NAME);
         DBUG_PRINT("info", ("Rename partition from %s to %s",
                    norm_name_buff, part_name_buff));
         error= file->rename_table((const char *) norm_name_buff,
@@ -763,14 +763,14 @@
           create_subpartition_name(norm_name_buff, path,
                                    part_elem->partition_name,
                                    sub_elem->partition_name,
-                                   ZNORMAL_PART_NAME);
+                                   NORMAL_PART_NAME);
           if (part_elem->part_state == PART_IS_CHANGED)
           {
             file= m_reorged_file[part_count++];
             create_subpartition_name(part_name_buff, path,
                                      part_elem->partition_name,
                                      sub_elem->partition_name,
-                                     ZRENAMED_PART_NAME);
+                                     RENAMED_PART_NAME);
             DBUG_PRINT("info", ("Rename subpartition from %s to %s",
                        norm_name_buff, part_name_buff));
             error= file->rename_table((const char *) norm_name_buff,
@@ -780,7 +780,7 @@
           create_subpartition_name(part_name_buff, path,
                                    part_elem->partition_name,
                                    sub_elem->partition_name,
-                                   ZTEMP_PART_NAME);
+                                   TEMP_PART_NAME);
           DBUG_PRINT("info", ("Rename subpartition from %s to %s",
                      part_name_buff, norm_name_buff));
           error= file->rename_table((const char *) part_name_buff,
@@ -790,12 +790,12 @@
       else
       {
         create_partition_name(norm_name_buff, path,
-                              part_elem->partition_name, ZNORMAL_PART_NAME);
+                              part_elem->partition_name, NORMAL_PART_NAME);
         if (part_elem->part_state == PART_IS_CHANGED)
         {
           file= m_reorged_file[part_count++];
           create_partition_name(part_name_buff, path,
-                                part_elem->partition_name, ZRENAMED_PART_NAME);
+                                part_elem->partition_name, RENAMED_PART_NAME);
           DBUG_PRINT("info", ("Rename partition from %s to %s",
                      norm_name_buff, part_name_buff));
           error= file->rename_table((const char *) norm_name_buff,
@@ -803,7 +803,7 @@
         }
         file= m_new_file[i];
         create_partition_name(part_name_buff, path,
-                              part_elem->partition_name, ZTEMP_PART_NAME);
+                              part_elem->partition_name, TEMP_PART_NAME);
         DBUG_PRINT("info", ("Rename partition from %s to %s",
                    part_name_buff, norm_name_buff));
         error= file->rename_table((const char *) part_name_buff,
@@ -1393,10 +1393,10 @@
         entirely new partition and PART_CHANGED means a changed partition
         that will still exist with either more or less data in it.
       */
-      uint name_variant= ZNORMAL_PART_NAME;
+      uint name_variant= NORMAL_PART_NAME;
       if (part_elem->part_state == PART_CHANGED ||
           (part_elem->part_state == PART_TO_BE_ADDED && temp_partitions))
-        name_variant= ZTEMP_PART_NAME;
+        name_variant= TEMP_PART_NAME;
       if (is_sub_partitioned(m_part_info))
       {
         List_iterator<partition_element> sub_it(part_elem->subpartitions);
@@ -1624,10 +1624,10 @@
   i= 0;
   do
   {
-    create_partition_name(from_buff, from, name_buffer_ptr, ZNORMAL_PART_NAME);
+    create_partition_name(from_buff, from, name_buffer_ptr, NORMAL_PART_NAME);
     if (to != NULL)
     {						// Rename branch
-      create_partition_name(to_buff, to, name_buffer_ptr, ZNORMAL_PART_NAME);
+      create_partition_name(to_buff, to, name_buffer_ptr, NORMAL_PART_NAME);
       error= (*file)->rename_table((const char*) from_buff,
 				   (const char*) to_buff);
     }
@@ -2166,7 +2166,7 @@
   file= m_file;
   do
   {
-    create_partition_name(name_buff, name, name_buffer_ptr, ZNORMAL_PART_NAME);
+    create_partition_name(name_buff, name, name_buffer_ptr, NORMAL_PART_NAME);
     if ((error= (*file)->ha_open(table, (const char*) name_buff, mode,
                                  test_if_locked)))
       goto err_handler;

--- 1.26/sql/sql_partition.cc	2006-01-03 05:04:06 +01:00
+++ 1.27/sql/sql_partition.cc	2006-01-03 16:34:51 +01:00
@@ -118,29 +118,29 @@
 
 #ifdef WITH_PARTITION_STORAGE_ENGINE
 /*
-  A support function to check if a partition name is in a list of strings
+  A support function to check if a name is in a list of strings
 
   SYNOPSIS
-    is_partition_in_list()
-    part_name          String searched for
-    list_part_names    A list of names searched in
+    is_name_in_list()
+    name               String searched for
+    list_names         A list of names searched in
 
   RETURN VALUES
     TRUE               String found
     FALSE              String not found
 */
 
-bool is_partition_in_list(char *part_name,
-                          List<char> list_part_names)
+bool is_name_in_list(char *name,
+                          List<char> list_names)
 {
-  List_iterator<char> part_names_it(list_part_names);
-  uint no_names= list_part_names.elements;
+  List_iterator<char> names_it(list_names);
+  uint no_names= list_names.elements;
   uint i= 0;
 
   do
   {
-    char *list_name= part_names_it++;
-    if (!(my_strcasecmp(system_charset_info, part_name, list_name)))
+    char *list_name= names_it++;
+    if (!(my_strcasecmp(system_charset_info, name, list_name)))
       return TRUE;
   } while (++i < no_names);
   return FALSE;
@@ -294,7 +294,7 @@
         break;
       if (!(my_strcasecmp(system_charset_info, old_name, new_name)))
       {
-        if (!is_partition_in_list(old_name, list_part_names))
+        if (!is_name_in_list(old_name, list_part_names))
           DBUG_RETURN(TRUE);
       }
     } while (old_count < no_old_parts);
@@ -4077,7 +4077,7 @@
     {
       uint new_part_no, curr_part_no;
       ulonglong max_rows= table->s->max_rows;
-      if (tab_part_info->part_type != HASH_PARTITION &&
+      if (tab_part_info->part_type != HASH_PARTITION ||
           tab_part_info->use_default_no_partitions)
       {
         my_error(ER_REORG_NO_PARAM_ERROR, MYF(0));
@@ -4393,8 +4393,8 @@
       do
       {
         partition_element *part_elem= part_it++;
-        if (is_partition_in_list(part_elem->partition_name,
-                                 alter_info->partition_names))
+        if (is_name_in_list(part_elem->partition_name,
+                            alter_info->partition_names))
         {
           /*
             Set state to indicate that the partition is to be dropped.
@@ -4434,8 +4434,8 @@
       {
         partition_element *part_elem= part_it++;
         if ((alter_info->flags & ALTER_ALL_PARTITION) ||
-            (is_partition_in_list(part_elem->partition_name,
-                                  alter_info->partition_names)))
+            (is_name_in_list(part_elem->partition_name,
+                             alter_info->partition_names)))
         {
           /*
             Mark the partition as a partition to be "changed" by
@@ -4465,15 +4465,6 @@
     }
     else if (alter_info->flags & ALTER_COALESCE_PARTITION)
     {
-      /*
-        In this version COALESCE PARTITION is implemented by simply removing
-        a partition from the table and using the normal ALTER TABLE code
-        and ensuring that copy to a new table occurs. Later on we can optimise
-        this function for Linear Hash partitions. In that case we can avoid
-        reorganising the entire table. For normal hash partitions it will
-        be a complete reorganise anyways so that can only be made on-line
-        if it still uses a copy table.
-      */
       uint no_parts_coalesced= alter_info->no_parts;
       uint no_parts_remain= tab_part_info->no_parts - no_parts_coalesced;
       List_iterator<partition_element> part_it(tab_part_info->partitions);
@@ -4503,8 +4494,8 @@
 to start with, using linear hash and coalescing one partition (always the
 last partition).
 
-Using normal linear hash then all remaining partitions will have a new
-reorganised part.
+Using linear hash then all remaining partitions will have a new reorganised
+part.
 
 Existing partitions                     Coalesced partition 
 ------       ------              ------   |      ------
@@ -4523,7 +4514,7 @@
 
 p0 - p3 is in the partitions list.
 The p1' partition will actually not be in any list it is deduced from the
-state of in p1.
+state of p1.
 */
       {
         uint part_count= 0, start_part= 1, start_sec_part= 1;
@@ -4653,8 +4644,8 @@
         do
         {
           partition_element *part_elem= tab_it++;
-          if (is_partition_in_list(part_elem->partition_name,
-                                   alter_info->partition_names))
+          if (is_name_in_list(part_elem->partition_name,
+                              alter_info->partition_names))
           {
             drop_count++;
             tab_max_range= part_elem->range_value;
Thread
bk commit into 5.1 tree (mikron:1.2015)mikael3 Jan