List:Commits« Previous MessageNext Message »
From:Stewart Smith Date:July 31 2007 11:50am
Subject:bk commit into 5.1 tree (pekka:1.2601)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of stewart. When stewart 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@stripped, 2007-07-31 21:50:34+10:00, pekka@stripped +1 -0
  [PATCH] alter online workaround
  
  Workaround for online alter. properly check if can be online
  
  Just a workaround until we decide what to do in TUP.
  Can you check?
  
  ===== sql/ha_ndbcluster.cc 1.486 vs edited =====
  Index: my51-t62-a/sql/ha_ndbcluster.cc
  ===================================================================

  sql/ha_ndbcluster.cc@stripped, 2007-07-31 10:00:00+10:00, pekka@stripped +16 -0
    alter online workaround

# 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:	pekka
# Host:	willster.(none)
# Root:	/home/stewart/Documents/MySQL/5.1/telco-6.2

--- 1.486/sql/ha_ndbcluster.cc	2007-07-28 06:03:24 +10:00
+++ 1.487/sql/ha_ndbcluster.cc	2007-07-31 10:00:00 +10:00
@@ -10766,11 +10766,21 @@
     }
   }
 
+  /*
+    Temporary workaround until TUP is fixed.
+    If no var or dyn attr, use copying alter table.
+  */
+  bool any_var_dyn_attr=false;
+
   for (i= 0; i < table->s->fields; i++)
   {
     Field *field= table->field[i];
     const NDBCOL *col= tab->getColumn(i);
 
+    if (col->getArrayType() != NdbDictionary::Column::ArrayTypeFixed ||
+        col->getDynamic())
+      any_var_dyn_attr=true;
+
     create_ndb_column(0, new_col, field, create_info);
     if (col->getStorageType() != new_col.getStorageType())
     {
@@ -10799,6 +10809,12 @@
   if (table_changes != IS_EQUAL_YES)
   {
     DBUG_PRINT("info", ("table_changes != IS_EQUAL_YES"));
+    DBUG_RETURN(HA_ALTER_NOT_SUPPORTED);
+  }
+
+  if (alter_flags->is_set(HA_ADD_COLUMN) && !any_var_dyn_attr)
+  {
+    DBUG_PRINT("info", ("no var dyn attr"));
     DBUG_RETURN(HA_ALTER_NOT_SUPPORTED);
   }
 
Thread
bk commit into 5.1 tree (pekka:1.2601)Stewart Smith31 Jul