List:Commits« Previous MessageNext Message »
From:Martin Skold Date:March 23 2012 2:52pm
Subject:bzr push into mysql-5.1-telco-7.0 branch (Martin.Skold:4903 to 4904)
Bug#13830980
View as plain text  
 4904 Martin Skold	2012-03-23
      Bug#13830980  MYSQL COMPLAINS OF NOT SUPPORTING ALTER ONLINE EVEN WHEN VALID OPTIONS ARE USED: Moved check upto handler to avoid valgrind warning

    modified:
      sql/ha_ndbcluster.cc
 4903 Frazer Clement	2012-03-23 [merge]
      Merge 6.3->7.0

    modified:
      storage/ndb/tools/ndb_size.pl
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2012-03-21 15:42:47 +0000
+++ b/sql/ha_ndbcluster.cc	2012-03-23 14:52:01 +0000
@@ -15071,14 +15071,30 @@ int ha_ndbcluster::check_if_supported_al
          DBUG_PRINT("info", ("storage_type %i, column_format %i",
                              (uint) field->field_storage_type(),
                              (uint) field->column_format()));
+         if (!(field->flags & NO_DEFAULT_VALUE_FLAG))
+         {
+           my_ptrdiff_t src_offset= field->table->s->default_values 
+             - field->table->record[0];
+           if ((! field->is_null_in_record_with_offset(src_offset)) ||
+               ((field->flags & NOT_NULL_FLAG)))
+           {
+             DBUG_PRINT("info",("Adding column with non-null default value is not supported on-line"));
+             DBUG_RETURN(HA_ALTER_NOT_SUPPORTED);
+           }
+         }
          /* Create new field to check if it can be added */
-         if ((my_errno= create_ndb_column(0, col, field, create_info,
+         if ((my_errno= create_ndb_column(thd, col, field, create_info,
                                           COLUMN_FORMAT_TYPE_DYNAMIC)))
          {
            DBUG_PRINT("info", ("create_ndb_column returned %u", my_errno));
            DBUG_RETURN(my_errno);
          }
-         new_tab.addColumn(col);
+         if (new_tab.addColumn(col))
+         {
+           my_errno= errno;
+           DBUG_PRINT("info", ("NdbDictionary::Table::addColumn returned %u", my_errno));
+           DBUG_RETURN(my_errno);
+         }
        }
      }
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (Martin.Skold:4903 to 4904)Bug#13830980Martin Skold26 Mar