List:Commits« Previous MessageNext Message »
From:Martin Skold Date:June 21 2012 10:01am
Subject:bzr push into mysql-5.1-telco-7.1 branch (Martin.Skold:4573 to 4574)
View as plain text  
 4574 Martin Skold	2012-06-21 [merge]
      Merge from 7.0

    modified:
      mysql-test/suite/ndb/r/ndb_alter_table_online.result
      mysql-test/suite/ndb/t/ndb_alter_table_online.test
      sql/sql_table.cc
 4573 Martin Skold	2012-06-15
      Removed initial restart of cluster in ndb_reconnect test since it reverts backup_id causing other test cases to fail, drop table internally in ndb instead

    modified:
      mysql-test/suite/ndb/t/ndb_reconnect.test
=== modified file 'mysql-test/suite/ndb/r/ndb_alter_table_online.result'
--- a/mysql-test/suite/ndb/r/ndb_alter_table_online.result	2012-06-08 07:53:18 +0000
+++ b/mysql-test/suite/ndb/r/ndb_alter_table_online.result	2012-06-21 09:23:58 +0000
@@ -649,3 +649,39 @@ alter online table t1 add e varchar(20) 
 ERROR 42000: This version of MySQL doesn't yet support 'alter online table t1 add e varchar(20) default 'x' column_format dynamic'
 alter online table t1 add e varchar(20) default null column_format dynamic;
 drop table t1;
+CREATE TABLE categorylinks (
+cl_from int(10) unsigned NOT NULL DEFAULT '0',
+cl_to varbinary(255) NOT NULL DEFAULT '',
+cl_sortkey varbinary(70) NOT NULL DEFAULT '',
+cl_timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
+CURRENT_TIMESTAMP,
+UNIQUE KEY cl_from (cl_from,cl_to),
+KEY cl_sortkey (cl_to,cl_sortkey,cl_from),
+KEY cl_timestamp (cl_to,cl_timestamp)
+) ENGINE=ndb DEFAULT CHARSET=binary;
+ALTER TABLE categorylinks
+CHANGE COLUMN cl_sortkey cl_sortkey varbinary(230) NOT NULL default
+'',
+ADD COLUMN cl_sortkey_prefix varchar(255) binary NOT NULL default '',
+ADD COLUMN cl_collation varbinary(32) NOT NULL default '',
+ADD COLUMN cl_type ENUM('page', 'subcat', 'file') NOT NULL default
+'page',
+ADD INDEX (cl_collation),
+DROP INDEX cl_sortkey,
+ADD INDEX cl_sortkey (cl_to, cl_type, cl_sortkey, cl_from);
+SHOW CREATE TABLE categorylinks;
+Table	Create Table
+categorylinks	CREATE TABLE `categorylinks` (
+  `cl_from` int(10) unsigned NOT NULL DEFAULT '0',
+  `cl_to` varbinary(255) NOT NULL DEFAULT '',
+  `cl_sortkey` varbinary(230) NOT NULL DEFAULT '',
+  `cl_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  `cl_sortkey_prefix` varbinary(255) NOT NULL DEFAULT '',
+  `cl_collation` varbinary(32) NOT NULL DEFAULT '',
+  `cl_type` enum('page','subcat','file') NOT NULL DEFAULT 'page',
+  UNIQUE KEY `cl_from` (`cl_from`,`cl_to`),
+  KEY `cl_timestamp` (`cl_to`,`cl_timestamp`),
+  KEY `cl_collation` (`cl_collation`),
+  KEY `cl_sortkey` (`cl_to`,`cl_type`,`cl_sortkey`,`cl_from`)
+) ENGINE=ndbcluster DEFAULT CHARSET=binary
+DROP TABLE categorylinks;

=== modified file 'mysql-test/suite/ndb/t/ndb_alter_table_online.test'
--- a/mysql-test/suite/ndb/t/ndb_alter_table_online.test	2012-06-08 07:53:18 +0000
+++ b/mysql-test/suite/ndb/t/ndb_alter_table_online.test	2012-06-21 09:23:58 +0000
@@ -702,3 +702,33 @@ create table t1(a int(10) unsigned not n
 alter online table t1 add e varchar(20) default 'x' column_format dynamic;
 alter online table t1 add e varchar(20) default null column_format dynamic;
 drop table t1;
+
+#
+# Bug #12755722 61528: INNODB BACKEND CRASHES ON ALTER TABLE STATEMENT (MYSQL SERVER HAS GONE AWAY
+#
+
+CREATE TABLE categorylinks (
+  cl_from int(10) unsigned NOT NULL DEFAULT '0',
+  cl_to varbinary(255) NOT NULL DEFAULT '',
+  cl_sortkey varbinary(70) NOT NULL DEFAULT '',
+  cl_timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE
+CURRENT_TIMESTAMP,
+  UNIQUE KEY cl_from (cl_from,cl_to),
+  KEY cl_sortkey (cl_to,cl_sortkey,cl_from),
+  KEY cl_timestamp (cl_to,cl_timestamp)
+) ENGINE=ndb DEFAULT CHARSET=binary;
+
+ALTER TABLE categorylinks
+        CHANGE COLUMN cl_sortkey cl_sortkey varbinary(230) NOT NULL default
+'',
+        ADD COLUMN cl_sortkey_prefix varchar(255) binary NOT NULL default '',
+        ADD COLUMN cl_collation varbinary(32) NOT NULL default '',
+        ADD COLUMN cl_type ENUM('page', 'subcat', 'file') NOT NULL default
+'page',
+        ADD INDEX (cl_collation),
+        DROP INDEX cl_sortkey,
+        ADD INDEX cl_sortkey (cl_to, cl_type, cl_sortkey, cl_from);
+
+SHOW CREATE TABLE categorylinks;
+
+DROP TABLE categorylinks;
\ No newline at end of file

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2012-06-07 09:06:47 +0000
+++ b/sql/sql_table.cc	2012-06-21 09:23:58 +0000
@@ -6077,8 +6077,11 @@ compare_tables(THD *thd,
     for(; key_part != end; key_part++)
     {
       /* Mark field to be part of new key */
-      if ((field= table->field[key_part->fieldnr]))
+      if (key_part->fieldnr < table->s->fields)
+      {
+        field= table->field[key_part->fieldnr];
         field->flags|= FIELD_IN_ADD_INDEX;
+      }
     }
     *table_changes= IS_EQUAL_NO;
     DBUG_PRINT("info", ("index changed: '%s'", table_key->name));
@@ -6112,18 +6115,18 @@ compare_tables(THD *thd,
       end= key_part + new_key->key_parts;
       for(; key_part != end; key_part++)
       {
+        if (key_part->fieldnr < table->s->fields)
+        {
+          field= table->field[key_part->fieldnr];
         /* Mark field to be part of new key */
-        if ((field= table->field[key_part->fieldnr]))
           field->flags|= FIELD_IN_ADD_INDEX;
         /*
           Check if all fields in key are declared
           NOT NULL
          */
-        if (key_part->fieldnr < table->s->fields)
-        {
           is_not_null=
             (is_not_null && 
-             (!table->field[key_part->fieldnr]->maybe_null()));
+             (!field->maybe_null()));
         }
         else
         {

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.1 branch (Martin.Skold:4573 to 4574) Martin Skold25 Jun