List:Commits« Previous MessageNext Message »
From:tomas Date:February 28 2006 12:30pm
Subject:bk commit into 5.1 tree (tomas:1.2189) BUG#17701
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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.2189 06/02/28 12:29:50 tomas@stripped +3 -0
  Bug #17701, ALTER TABLE t1 ADD PARTITION for PARTITION BY LIST hangs test
  - code wrongly tries to do a "fast alter partition", although not supported

  sql/sql_partition.h
    1.5 06/02/28 12:29:44 tomas@stripped +0 -29
    moved defines

  sql/sql_partition.cc
    1.42 06/02/28 12:29:44 tomas@stripped +5 -3
    Bug #17701, ALTER TABLE t1 ADD PARTITION for PARTITION BY LIST hangs test
    - code wrongly tries to do a "fast alter partition", although not supported

  sql/handler.h
    1.197 06/02/28 12:29:44 tomas@stripped +28 -0
    moved defines

# 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:	tomas
# Host:	poseidon.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-new

--- 1.196/sql/handler.h	2006-02-26 14:12:50 +01:00
+++ 1.197/sql/handler.h	2006-02-28 12:29:44 +01:00
@@ -130,6 +130,34 @@
 #define HA_ONLINE_DROP_UNIQUE_INDEX             (1L << 9) /*drop uniq. online*/
 #define HA_ONLINE_ADD_PK_INDEX                  (1L << 10)/*add prim. online*/
 #define HA_ONLINE_DROP_PK_INDEX                 (1L << 11)/*drop prim. online*/
+/*
+  HA_PARTITION_FUNCTION_SUPPORTED indicates that the function is
+  supported at all.
+  HA_FAST_CHANGE_PARTITION means that optimised variants of the changes
+  exists but they are not necessarily done online.
+
+  HA_ONLINE_DOUBLE_WRITE means that the handler supports writing to both
+  the new partition and to the old partitions when updating through the
+  old partitioning schema while performing a change of the partitioning.
+  This means that we can support updating of the table while performing
+  the copy phase of the change. For no lock at all also a double write
+  from new to old must exist and this is not required when this flag is
+  set.
+  This is actually removed even before it was introduced the first time.
+  The new idea is that handlers will handle the lock level already in
+  store_lock for ALTER TABLE partitions.
+
+  HA_PARTITION_ONE_PHASE is a flag that can be set by handlers that take
+  care of changing the partitions online and in one phase. Thus all phases
+  needed to handle the change are implemented inside the storage engine.
+  The storage engine must also support auto-discovery since the frm file
+  is changed as part of the change and this change must be controlled by
+  the storage engine. A typical engine to support this is NDB (through
+  WL #2498).
+*/
+#define HA_PARTITION_FUNCTION_SUPPORTED         (1L << 12)
+#define HA_FAST_CHANGE_PARTITION                (1L << 13)
+#define HA_PARTITION_ONE_PHASE                  (1L << 14)
 
 /*
   Index scan will not return records in rowid order. Not guaranteed to be

--- 1.41/sql/sql_partition.cc	2006-02-25 22:20:54 +01:00
+++ 1.42/sql/sql_partition.cc	2006-02-28 12:29:44 +01:00
@@ -4011,7 +4011,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)
     {
@@ -4060,7 +4060,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)
     {
       /*
@@ -4660,7 +4663,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)

--- 1.4/sql/sql_partition.h	2006-02-22 00:39:57 +01:00
+++ 1.5/sql/sql_partition.h	2006-02-28 12:29:44 +01:00
@@ -24,35 +24,6 @@
 #define HA_CAN_PARTITION_UNIQUE (1 << 2)
 #define HA_USE_AUTO_PARTITION (1 << 3)
 
-/*
-  HA_PARTITION_FUNCTION_SUPPORTED indicates that the function is
-  supported at all.
-  HA_FAST_CHANGE_PARTITION means that optimised variants of the changes
-  exists but they are not necessarily done online.
-
-  HA_ONLINE_DOUBLE_WRITE means that the handler supports writing to both
-  the new partition and to the old partitions when updating through the
-  old partitioning schema while performing a change of the partitioning.
-  This means that we can support updating of the table while performing
-  the copy phase of the change. For no lock at all also a double write
-  from new to old must exist and this is not required when this flag is
-  set.
-  This is actually removed even before it was introduced the first time.
-  The new idea is that handlers will handle the lock level already in
-  store_lock for ALTER TABLE partitions.
-
-  HA_PARTITION_ONE_PHASE is a flag that can be set by handlers that take
-  care of changing the partitions online and in one phase. Thus all phases
-  needed to handle the change are implemented inside the storage engine.
-  The storage engine must also support auto-discovery since the frm file
-  is changed as part of the change and this change must be controlled by
-  the storage engine. A typical engine to support this is NDB (through
-  WL #2498).
-*/
-#define HA_PARTITION_FUNCTION_SUPPORTED         (1L << 12)
-#define HA_FAST_CHANGE_PARTITION                (1L << 13)
-#define HA_PARTITION_ONE_PHASE                  (1L << 14)
-
 /*typedef struct {
   ulonglong data_file_length;
   ulonglong max_data_file_length;
Thread
bk commit into 5.1 tree (tomas:1.2189) BUG#17701tomas28 Feb