mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge zim.(none):/home/mikael/bug17127
into zim.(none):/home/mikael/bug16370
This commit is contained in:
@@ -692,12 +692,19 @@ bool check_partition_info(partition_info *part_info,handlerton **eng_type,
|
||||
char *same_name;
|
||||
DBUG_ENTER("check_partition_info");
|
||||
|
||||
if (unlikely(!part_info->is_sub_partitioned() &&
|
||||
!(part_info->use_default_subpartitions &&
|
||||
part_info->use_default_no_subpartitions)))
|
||||
{
|
||||
my_error(ER_SUBPARTITION_ERROR, MYF(0));
|
||||
goto end;
|
||||
}
|
||||
if (unlikely(part_info->is_sub_partitioned() &&
|
||||
(!(part_info->part_type == RANGE_PARTITION ||
|
||||
part_info->part_type == LIST_PARTITION))))
|
||||
{
|
||||
/* Only RANGE and LIST partitioning can be subpartitioned */
|
||||
my_error(ER_SUBPARTITION_ERROR, MYF(0));
|
||||
my_error(ER_PARTITION_SUBPART_MIX_ERROR, MYF(0));
|
||||
goto end;
|
||||
}
|
||||
if (unlikely(part_info->set_up_defaults_for_partitioning(file,
|
||||
@@ -4078,6 +4085,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
|
||||
ALTER_REPAIR_PARTITION | ALTER_REBUILD_PARTITION))
|
||||
{
|
||||
partition_info *tab_part_info= table->part_info;
|
||||
partition_info *alt_part_info= thd->lex->part_info;
|
||||
uint flags= 0;
|
||||
if (!tab_part_info)
|
||||
{
|
||||
@@ -4172,7 +4180,6 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
|
||||
partitioning scheme as currently set-up.
|
||||
Partitions are always added at the end in ADD PARTITION.
|
||||
*/
|
||||
partition_info *alt_part_info= thd->lex->part_info;
|
||||
uint no_new_partitions= alt_part_info->no_parts;
|
||||
uint no_orig_partitions= tab_part_info->no_parts;
|
||||
uint check_total_partitions= no_new_partitions + no_orig_partitions;
|
||||
@@ -4767,6 +4774,12 @@ the generated partition syntax in a correct manner.
|
||||
if (alter_info->flags == ALTER_ADD_PARTITION ||
|
||||
alter_info->flags == ALTER_REORGANIZE_PARTITION)
|
||||
{
|
||||
if (tab_part_info->use_default_subpartitions &&
|
||||
!alt_part_info->use_default_subpartitions)
|
||||
{
|
||||
tab_part_info->use_default_subpartitions= FALSE;
|
||||
tab_part_info->use_default_no_subpartitions= FALSE;
|
||||
}
|
||||
if (check_partition_info(tab_part_info, (handlerton**)NULL,
|
||||
table->file, ULL(0)))
|
||||
{
|
||||
|
Reference in New Issue
Block a user