1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

BUG 19062: CREATE TABLE ... PARTITION BY ... AS SELECT don't create partitioned table

This commit is contained in:
mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se
2006-05-04 13:18:55 -04:00
parent 4ba1a4b3cd
commit b32237c3a7
3 changed files with 30 additions and 9 deletions

View File

@ -886,4 +886,13 @@ s1
2
3
drop table t1;
create table t1 (a varchar(1))
partition by key (a)
as select 'a';
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a)
drop table t1;
End of 5.1 tests

View File

@ -1009,4 +1009,14 @@ select auto_increment from information_schema.tables where table_name='t1';
select * from t1;
drop table t1;
#
# BUG 19062 Partition clause ignored if CREATE TABLE ... AS SELECT ...;
#
create table t1 (a varchar(1))
partition by key (a)
as select 'a';
show create table t1;
drop table t1;
--echo End of 5.1 tests

View File

@ -2855,6 +2855,17 @@ mysql_execute_command(THD *thd)
res= 1;
goto end_with_restore_list;
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
{
partition_info *part_info= thd->lex->part_info;
if (part_info && !(part_info= thd->lex->part_info->get_clone()))
{
res= -1;
goto end_with_restore_list;
}
thd->work_part_info= part_info;
}
#endif
if (select_lex->item_list.elements) // With select
{
select_result *result;
@ -2924,15 +2935,6 @@ mysql_execute_command(THD *thd)
lex->like_name);
else
{
#ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info *part_info= thd->lex->part_info;
if (part_info && !(part_info= thd->lex->part_info->get_clone()))
{
res= -1;
goto end_with_restore_list;
}
thd->work_part_info= part_info;
#endif
res= mysql_create_table(thd, create_table->db,
create_table->table_name, &lex->create_info,
lex->create_list,