Commit 0fe103f9 authored by holyfoot/hf@hfmain.(none)'s avatar holyfoot/hf@hfmain.(none)

Merge bk@192.168.21.1:mysql-5.1-opt

into  mysql.com:/home/hf/work/31893/my51-31893
parents d4dc2c3a edbf4120
...@@ -1291,4 +1291,18 @@ t1 CREATE TABLE `t1` ( ...@@ -1291,4 +1291,18 @@ t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL `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) */ ) 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; 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 End of 5.1 tests
...@@ -1528,4 +1528,15 @@ PARTITION BY RANGE (b) ( ...@@ -1528,4 +1528,15 @@ PARTITION BY RANGE (b) (
show create table t1; show create table t1;
drop table t1, t2; 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 --echo End of 5.1 tests
...@@ -5031,7 +5031,10 @@ the generated partition syntax in a correct manner. ...@@ -5031,7 +5031,10 @@ the generated partition syntax in a correct manner.
*partition_changed= TRUE; *partition_changed= TRUE;
} }
if (create_info->db_type == partition_hton) if (create_info->db_type == partition_hton)
{
if (!part_info->default_engine_type)
part_info->default_engine_type= table->part_info->default_engine_type; part_info->default_engine_type= table->part_info->default_engine_type;
}
else else
part_info->default_engine_type= create_info->db_type; part_info->default_engine_type= create_info->db_type;
if (check_native_partitioned(create_info, &is_native_partitioned, if (check_native_partitioned(create_info, &is_native_partitioned,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment