List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:February 4 2011 8:31am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4170)
View as plain text  
#At file:///home/msvensson/mysql/7.0/ based on revid:magnus.blaudd@stripped

 4170 Magnus Blåudd	2011-02-04
      ndb
       - install ndbcluster_alter_table_flags to handlerton if ALTER ONLINE
        is not supported

    modified:
      sql/ha_ndbcluster.cc
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-02-04 08:01:56 +0000
+++ b/sql/ha_ndbcluster.cc	2011-02-04 08:31:48 +0000
@@ -254,7 +254,6 @@ static MYSQL_THDVAR_UINT(
 */
 static const int max_transactions= 4;
 
-static uint ndbcluster_partition_flags();
 static int ndbcluster_init(void *);
 static int ndbcluster_end(handlerton *hton, ha_panic_function flag);
 static bool ndbcluster_show_status(handlerton *hton, THD*,
@@ -300,17 +299,30 @@ static handler *ndbcluster_create_handle
   return new (mem_root) ha_ndbcluster(hton, table);
 }
 
-static uint ndbcluster_partition_flags()
+static uint
+ndbcluster_partition_flags()
 {
   return (HA_CAN_PARTITION | HA_CAN_UPDATE_PARTITION_KEY |
           HA_CAN_PARTITION_UNIQUE | HA_USE_AUTO_PARTITION);
 }
 
 #ifndef NDB_WITHOUT_ONLINE_ALTER
-static uint ndbcluster_alter_partition_flags()
+static uint
+ndbcluster_alter_partition_flags()
 {
   return HA_PARTITION_FUNCTION_SUPPORTED;
 }
+#else
+static uint
+ndbcluster_alter_table_flags(uint flags)
+{
+  if (flags & ALTER_DROP_PARTITION)
+    return 0;
+  else
+    return (HA_ONLINE_ADD_INDEX | HA_ONLINE_DROP_INDEX |
+            HA_ONLINE_ADD_UNIQUE_INDEX | HA_ONLINE_DROP_UNIQUE_INDEX |
+            HA_PARTITION_FUNCTION_SUPPORTED);
+}
 #endif
 
 #define NDB_AUTO_INCREMENT_RETRIES 100
@@ -10423,9 +10435,10 @@ static int ndbcluster_init(void *p)
     h->partition_flags=  ndbcluster_partition_flags; /* Partition flags */
 #ifndef NDB_WITHOUT_ONLINE_ALTER
     h->alter_partition_flags=
-      ndbcluster_alter_partition_flags;             /* Alter table flags */
+      ndbcluster_alter_partition_flags;             /* Alter partition flags */
 #else
-    /* Should install alter_table_flags */
+    h->alter_table_flags=
+      ndbcluster_alter_table_flags;                 /* Alter table flags */
 #endif
 #if MYSQL_VERSION_ID >= 50501
     h->fill_is_table=    ndbcluster_fill_is_table;

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@oracle.com-20110204083148-yrujrbud57sl71op.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4170) Magnus Blåudd4 Feb