List:Commits« Previous MessageNext Message »
From:holyfoot Date:October 31 2007 12:01pm
Subject:bk commit into 5.1 tree (holyfoot:1.2615) BUG#31893
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of hf. When hf 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@stripped, 2007-10-31 16:01:29+04:00, holyfoot@stripped +3 -0
  Bug #31893 Partitions: crash if subpartitions and engine change.
  
  The new default database engine for altered table was reassigned to
  the old one. That's wrong thing by itself, and (as the engine
  for a subpartition gets that new value) leads to DBUG_ASSERTION
  in mysql_unpack_partition()

  mysql-test/r/partition.result@stripped, 2007-10-31 16:01:26+04:00, holyfoot@stripped +14 -0
    Bug #31893 Partitions: crash if subpartitions and engine change.
    
    test result

  mysql-test/t/partition.test@stripped, 2007-10-31 16:01:26+04:00, holyfoot@stripped +11 -0
    Bug #31893 Partitions: crash if subpartitions and engine change.
    
    test case

  sql/sql_partition.cc@stripped, 2007-10-31 16:01:26+04:00, holyfoot@stripped +4 -1
    Bug #31893 Partitions: crash if subpartitions and engine change.
    
    Don't change part_info->default_engine_type if it's already set

diff -Nrup a/mysql-test/r/partition.result b/mysql-test/r/partition.result
--- a/mysql-test/r/partition.result	2007-10-20 01:03:16 +05:00
+++ b/mysql-test/r/partition.result	2007-10-31 16:01:26 +04:00
@@ -1291,4 +1291,18 @@ t1	CREATE TABLE `t1` (
   `b` int(11) DEFAULT NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (b) (PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (20) ENGINE = MyISAM) */
 drop table t1, t2;
+create table t1 (int_column int, char_column char(5))
+PARTITION BY RANGE (int_column) subpartition by key (char_column)
+(PARTITION p1 VALUES LESS THAN (5) ENGINE = InnoDB);
+Warnings:
+Warning	1286	Unknown table engine 'InnoDB'
+alter table t1 PARTITION BY RANGE (int_column) subpartition by key (char_column)
+(PARTITION p1 VALUES LESS THAN (5) ENGINE = myisam);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `int_column` int(11) DEFAULT NULL,
+  `char_column` char(5) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (int_column) SUBPARTITION BY KEY (char_column) (PARTITION p1 VALUES LESS THAN (5) ENGINE = MyISAM) */
+drop table t1;
 End of 5.1 tests
diff -Nrup a/mysql-test/t/partition.test b/mysql-test/t/partition.test
--- a/mysql-test/t/partition.test	2007-10-20 01:03:16 +05:00
+++ b/mysql-test/t/partition.test	2007-10-31 16:01:26 +04:00
@@ -1528,4 +1528,15 @@ PARTITION BY RANGE (b) (
 show create table t1;
 drop table t1, t2;
 
+#
+# Bug #31893 Partitions: crash if subpartitions and engine change
+#
+create table t1 (int_column int, char_column char(5))
+  PARTITION BY RANGE (int_column) subpartition by key (char_column)
+  (PARTITION p1 VALUES LESS THAN (5) ENGINE = InnoDB);
+alter table t1 PARTITION BY RANGE (int_column) subpartition by key (char_column)
+  (PARTITION p1 VALUES LESS THAN (5) ENGINE = myisam);
+show create table t1;
+drop table t1;
+
 --echo End of 5.1 tests
diff -Nrup a/sql/sql_partition.cc b/sql/sql_partition.cc
--- a/sql/sql_partition.cc	2007-10-09 19:16:37 +05:00
+++ b/sql/sql_partition.cc	2007-10-31 16:01:26 +04:00
@@ -5031,7 +5031,10 @@ the generated partition syntax in a corr
         *partition_changed= TRUE;
       }
       if (create_info->db_type == partition_hton)
-        part_info->default_engine_type= table->part_info->default_engine_type;
+      {
+        if (!part_info->default_engine_type)
+          part_info->default_engine_type= table->part_info->default_engine_type;
+      }
       else
         part_info->default_engine_type= create_info->db_type;
       if (check_native_partitioned(create_info, &is_native_partitioned,
Thread
bk commit into 5.1 tree (holyfoot:1.2615) BUG#31893holyfoot31 Oct