From: Mattias Jonsson Date: November 16 2010 12:56am Subject: bzr commit into mysql-trunk branch (mattias.jonsson:3343) List-Archive: http://lists.mysql.com/commits/123963 Message-Id: <201011160057.oAFJlwNu012730@acsinet15.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///Users/mattiasj/mysql-bzr/topush-trunk-bugfixing/ based on revid:mattias.jonsson@stripped 3343 Mattias Jonsson 2010-11-16 [merge] merge modified: mysql-test/r/partition_exchange.result mysql-test/t/partition_exchange.test sql/sql_partition_admin.cc === modified file 'mysql-test/r/partition_exchange.result' --- a/mysql-test/r/partition_exchange.result 2010-11-16 00:39:46 +0000 +++ b/mysql-test/r/partition_exchange.result 2010-11-16 00:55:42 +0000 @@ -1,10 +1,24 @@ DROP TABLE IF EXISTS t1, t2, t3, t, tp, tsp, tmp; -CREATE TABLE t1 (s1 INT PRIMARY KEY) engine=innodb; -CREATE TABLE t2 (s1 INT, FOREIGN KEY (s1) REFERENCES t1 (s1)) engine=innodb; +# +# Bug#56484: !table || (!table->read_set || +# bitmap_is_set(table->read_set, field_index)) +# +CREATE TABLE t1 (a INT NOT NULL,b TIME NOT NULL DEFAULT '00:00:00') +ENGINE=MyISAM +PARTITION BY HASH (a) PARTITIONS 2; +CREATE TABLE t2 (a INT) ENGINE=MYISAM; +ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2; +ERROR HY000: Tables have different definitions +DROP TABLE t1, t2; +# +# Bug#55784: Foreign key integrity broken by alter table +# +CREATE TABLE t1 (s1 INT PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE t2 (s1 INT, FOREIGN KEY (s1) REFERENCES t1 (s1)) ENGINE=InnoDB; INSERT INTO t1 VALUES (1),(2),(3); INSERT INTO t2 VALUES (1),(2),(3); CREATE TABLE t3 (s1 INT PRIMARY KEY) -engine=innodb +ENGINE=InnoDB PARTITION BY LIST (s1) (PARTITION p1 VALUES IN (1,2,3)); ALTER TABLE t3 EXCHANGE PARTITION p1 WITH TABLE t1; === modified file 'mysql-test/t/partition_exchange.test' --- a/mysql-test/t/partition_exchange.test 2010-10-29 10:20:18 +0000 +++ b/mysql-test/t/partition_exchange.test 2010-11-16 00:55:42 +0000 @@ -5,16 +5,32 @@ DROP TABLE IF EXISTS t1, t2, t3, t, tp, tsp, tmp; --enable_warnings -CREATE TABLE t1 (s1 INT PRIMARY KEY) engine=innodb; +--echo # +--echo # Bug#56484: !table || (!table->read_set || +--echo # bitmap_is_set(table->read_set, field_index)) +--echo # +CREATE TABLE t1 (a INT NOT NULL,b TIME NOT NULL DEFAULT '00:00:00') +ENGINE=MyISAM +PARTITION BY HASH (a) PARTITIONS 2; -CREATE TABLE t2 (s1 INT, FOREIGN KEY (s1) REFERENCES t1 (s1)) engine=innodb; +CREATE TABLE t2 (a INT) ENGINE=MYISAM; +--error ER_TABLES_DIFFERENT_METADATA +ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t2; +DROP TABLE t1, t2; + +--echo # +--echo # Bug#55784: Foreign key integrity broken by alter table +--echo # +CREATE TABLE t1 (s1 INT PRIMARY KEY) ENGINE=InnoDB; + +CREATE TABLE t2 (s1 INT, FOREIGN KEY (s1) REFERENCES t1 (s1)) ENGINE=InnoDB; INSERT INTO t1 VALUES (1),(2),(3); INSERT INTO t2 VALUES (1),(2),(3); CREATE TABLE t3 (s1 INT PRIMARY KEY) - engine=innodb + ENGINE=InnoDB PARTITION BY LIST (s1) (PARTITION p1 VALUES IN (1,2,3)); === modified file 'sql/sql_partition_admin.cc' --- a/sql/sql_partition_admin.cc 2010-11-16 00:39:46 +0000 +++ b/sql/sql_partition_admin.cc 2010-11-16 00:55:42 +0000 @@ -191,6 +191,9 @@ static bool compare_table_with_partition update_create_info_from_table(&table_create_info, table); /* get the current auto_increment value */ table->file->update_create_info(&table_create_info); + /* mark all columns used, since they are used when preparing the new table */ + part_table->use_all_columns(); + table->use_all_columns(); if (mysql_prepare_alter_table(thd, part_table, &part_create_info, &part_alter_info)) { No bundle (reason: revision is a merge).