MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Martin Skold Date:June 13 2006 2:44pm
Subject:bk commit into 5.1 tree (mskold:1.2186)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of marty. When marty 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.2186 06/06/13 16:44:30 mskold@stripped +4 -0
  Fixed incorrect handling of renamed fields, forcing copy of table if needed and added optional system variable ndb_use_copying_alter_table

  sql/sql_class.h
    1.297 06/06/13 16:44:02 mskold@stripped +1 -0
    Fixed incorrect handling of renamed fields, forcing copy of table if needed and added optional system variable ndb_use_copying_alter_table

  sql/set_var.cc
    1.180 06/06/13 16:44:02 mskold@stripped +4 -0
    Fixed incorrect handling of renamed fields, forcing copy of table if needed and added optional system variable ndb_use_copying_alter_table

  sql/mysqld.cc
    1.554 06/06/13 16:44:01 mskold@stripped +7 -0
    Fixed incorrect handling of renamed fields, forcing copy of table if needed and added optional system variable ndb_use_copying_alter_table

  sql/ha_ndbcluster.cc
    1.320 06/06/13 16:44:01 mskold@stripped +11 -0
    Fixed incorrect handling of renamed fields, forcing copy of table if needed and added optional system variable ndb_use_copying_alter_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:	mskold
# Host:	linux.site
# Root:	/home/marty/MySQL/mysql-5.1

--- 1.553/sql/mysqld.cc	2006-06-09 09:07:27 +02:00
+++ 1.554/sql/mysqld.cc	2006-06-13 16:44:01 +02:00
@@ -4695,6 +4695,7 @@ enum options_mysqld
   OPT_NDB_EXTRA_LOGGING,
   OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
   OPT_NDB_REPORT_THRESH_BINLOG_MEM_USAGE,
+  OPT_NDB_USE_COPYING_ALTER_TABLE,
   OPT_SKIP_SAFEMALLOC,
   OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_COMPLETION_TYPE,
   OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS,
@@ -5430,6 +5431,12 @@ Disable with --skip-ndbcluster (will sav
    (gptr*) &max_system_variables.ndb_index_stat_update_freq,
    0, GET_ULONG, OPT_ARG, 20, 0, ~0L, 0, 0, 0},
 #endif
+  {"nb-use-copying-alter-table",
+   OPT_NDB_USE_COPYING_ALTER_TABLE,
+   "Force ndbcluster to always copy tables at alter table (used for ensuring that operations such as renaming fields are propagated to ndb data dictionary).",
+   (gptr*) &global_system_variables.ndb_use_copying_alter_table,
+   (gptr*) &global_system_variables.ndb_use_copying_alter_table,
+   0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},  
   {"new", 'n', "Use very new possible 'unsafe' functions.",
    (gptr*) &global_system_variables.new_mode,
    (gptr*) &max_system_variables.new_mode,

--- 1.296/sql/sql_class.h	2006-06-04 18:23:49 +02:00
+++ 1.297/sql/sql_class.h	2006-06-13 16:44:02 +02:00
@@ -244,6 +244,7 @@ struct system_variables
   my_bool innodb_table_locks;
   my_bool innodb_support_xa;
   my_bool ndb_force_send;
+  my_bool ndb_use_copying_alter_table;
   my_bool ndb_use_exact_count;
   my_bool ndb_use_transactions;
   my_bool ndb_index_stat_enable;

--- 1.319/sql/ha_ndbcluster.cc	2006-06-12 14:13:01 +02:00
+++ 1.320/sql/ha_ndbcluster.cc	2006-06-13 16:44:01 +02:00
@@ -9824,10 +9824,21 @@ bool ha_ndbcluster::check_if_incompatibl
   uint i;
   const NDBTAB *tab= (const NDBTAB *) m_table;
 
+  if (current_thd->variables.ndb_use_copying_alter_table)
+  {
+    DBUG_PRINT("info", ("On-line alter table disabled"));
+    DBUG_RETURN(COMPATIBLE_DATA_NO);
+  }
+
   for (i= 0; i < table->s->fields; i++) 
   {
     Field *field= table->field[i];
     const NDBCOL *col= tab->getColumn(field->field_name);
+    if (!col)
+    {
+      DBUG_PRINT("info", ("Field has been renamed, copy table"));
+      DBUG_RETURN(COMPATIBLE_DATA_NO);
+    }
     if ((field->flags & FIELD_IN_ADD_INDEX) &&
         col->getStorageType() == NdbDictionary::Column::StorageTypeDisk)
     {

--- 1.179/sql/set_var.cc	2006-06-04 18:23:41 +02:00
+++ 1.180/sql/set_var.cc	2006-06-13 16:44:02 +02:00
@@ -548,6 +548,8 @@ sys_ndb_index_stat_update_freq("ndb_inde
                                &SV::ndb_index_stat_update_freq);
 sys_var_long_ptr
 sys_ndb_extra_logging("ndb_extra_logging", &ndb_extra_logging);
+sys_var_thd_bool
+sys_ndb_use_copying_alter_table("ndb_use_copying_alter_table", &SV::ndb_use_copying_alter_table);
 
 /* Time/date/datetime formats */
 
@@ -917,6 +919,8 @@ SHOW_VAR init_vars[]= {
   {sys_ndb_report_thresh_binlog_mem_usage.name,
    (char*) &sys_ndb_report_thresh_binlog_mem_usage,                 SHOW_SYS},
 #endif
+  {sys_ndb_use_copying_alter_table.name,
+   (char*) &sys_ndb_use_copying_alter_table,                        SHOW_SYS},
   {sys_ndb_use_exact_count.name,(char*) &sys_ndb_use_exact_count,   SHOW_SYS},
   {sys_ndb_use_transactions.name,(char*) &sys_ndb_use_transactions, SHOW_SYS},
   {sys_net_buffer_length.name,(char*) &sys_net_buffer_length,       SHOW_SYS},
Thread
bk commit into 5.1 tree (mskold:1.2186)Martin Skold13 Jun