List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:March 9 2011 2:03pm
Subject:bzr commit into mysql-trunk branch (mattias.jonsson:3738) Bug#60039
Bug#11766232
View as plain text  
#At file:///Users/mattiasj/mysql-bzr/topush-trunk/ based on revid:andrei.elkin@stripped

 3738 Mattias Jonsson	2011-03-09 [merge]
      merge of bug#11766232 (bug#60039).

    modified:
      mysql-test/r/partition_error.result
      mysql-test/t/partition_error.test
      sql/sql_partition_admin.cc
=== modified file 'mysql-test/r/partition_error.result'
--- a/mysql-test/r/partition_error.result	2011-03-01 14:47:01 +0000
+++ b/mysql-test/r/partition_error.result	2011-03-09 14:03:46 +0000
@@ -1,5 +1,15 @@
 drop table if exists t1, t2;
 #
+# Bug#60039: crash when exchanging a partition on
+#            nonpartitioned table with a view
+#
+CREATE TABLE t1 (a int);
+CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1;
+ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE v1;
+ERROR 42000: Can't open table
+DROP VIEW v1;
+DROP TABLE t1;
+#
 # Bug#57924: crash when creating partitioned table with
 #            multiple columns in the partition key
 #

=== modified file 'mysql-test/t/partition_error.test'
--- a/mysql-test/t/partition_error.test	2011-03-01 14:47:01 +0000
+++ b/mysql-test/t/partition_error.test	2011-03-09 14:03:46 +0000
@@ -11,6 +11,17 @@ drop table if exists t1, t2;
 let $MYSQLD_DATADIR= `SELECT @@datadir`;
 
 --echo #
+--echo # Bug#60039: crash when exchanging a partition on
+--echo #            nonpartitioned table with a view
+--echo #
+CREATE TABLE t1 (a int);
+CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1;
+--error ER_CHECK_NO_SUCH_TABLE
+ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE v1;
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo #
 --echo # Bug#57924: crash when creating partitioned table with
 --echo #            multiple columns in the partition key
 --echo #

=== modified file 'sql/sql_partition_admin.cc'
--- a/sql/sql_partition_admin.cc	2010-12-03 10:05:56 +0000
+++ b/sql/sql_partition_admin.cc	2011-02-10 09:49:47 +0000
@@ -527,11 +527,12 @@ bool Sql_cmd_alter_table_exchange_partit
 
   part_table= table_list->table;
   swap_table= swap_table_list->table;
-  table_hton= swap_table->file->ht;
 
   if (check_exchange_partition(swap_table, part_table))
     DBUG_RETURN(TRUE);
 
+  table_hton= swap_table->file->ht;
+
   thd_proc_info(thd, "verifying table");
 
   /* Will append the partition name later in part_info->get_part_elem() */

No bundle (reason: revision is a merge).
Thread
bzr commit into mysql-trunk branch (mattias.jonsson:3738) Bug#60039Bug#11766232Mattias Jonsson9 Mar