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:

parent
4ba1a4b3cd
commit
b32237c3a7
@ -886,4 +886,13 @@ s1
|
|||||||
2
|
2
|
||||||
3
|
3
|
||||||
drop table t1;
|
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
|
End of 5.1 tests
|
||||||
|
@ -1009,4 +1009,14 @@ select auto_increment from information_schema.tables where table_name='t1';
|
|||||||
select * from t1;
|
select * from t1;
|
||||||
drop table 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
|
--echo End of 5.1 tests
|
||||||
|
@ -2855,6 +2855,17 @@ mysql_execute_command(THD *thd)
|
|||||||
res= 1;
|
res= 1;
|
||||||
goto end_with_restore_list;
|
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
|
if (select_lex->item_list.elements) // With select
|
||||||
{
|
{
|
||||||
select_result *result;
|
select_result *result;
|
||||||
@ -2924,15 +2935,6 @@ mysql_execute_command(THD *thd)
|
|||||||
lex->like_name);
|
lex->like_name);
|
||||||
else
|
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,
|
res= mysql_create_table(thd, create_table->db,
|
||||||
create_table->table_name, &lex->create_info,
|
create_table->table_name, &lex->create_info,
|
||||||
lex->create_list,
|
lex->create_list,
|
||||||
|
Reference in New Issue
Block a user