mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
BUG#19067: Crash when ALTER TABLE for default subpartitioned table
mysql-test/r/partition.result: New test cases mysql-test/r/partition_02myisam.result: ENGINE always specified per partition in show table mysql-test/t/partition.test: New test cases sql/partition_element.h: New copy constructor for partition_element sql/partition_info.cc: Use new copy constructor to ensure default subpartitions inherit partition options from parent Ensure engine is always set on both partitions and subpartitions sql/sql_partition.cc: Removed unneeded bool to generate_partition_syntax Write partition options also for subpartitioned tables when subpartitioning is by default Set up defaults for new partitions also in REORGANIZE PARTITION sql/sql_partition.h: Removed unneeded parameter to generate_partition_syntax call sql/sql_show.cc: Removed unneeded parameter to generate_partition_syntax call sql/sql_table.cc: Removed unneeded parameter to generate_partition_syntax call
This commit is contained in:
@@ -1754,7 +1754,6 @@ end:
|
||||
buf_length A pointer to the returned buffer length
|
||||
use_sql_alloc Allocate buffer from sql_alloc if true
|
||||
otherwise use my_malloc
|
||||
write_all Write everything, also default values
|
||||
|
||||
RETURN VALUES
|
||||
NULL error
|
||||
@@ -1782,8 +1781,7 @@ end:
|
||||
|
||||
char *generate_partition_syntax(partition_info *part_info,
|
||||
uint *buf_length,
|
||||
bool use_sql_alloc,
|
||||
bool write_all)
|
||||
bool use_sql_alloc)
|
||||
{
|
||||
uint i,j, tot_no_parts, no_subparts, no_parts;
|
||||
partition_element *part_elem;
|
||||
@@ -1869,7 +1867,7 @@ char *generate_partition_syntax(partition_info *part_info,
|
||||
tot_no_parts= no_parts + no_temp_parts;
|
||||
no_subparts= part_info->no_subparts;
|
||||
|
||||
if (write_all || (!part_info->use_default_partitions))
|
||||
if (!part_info->use_default_partitions)
|
||||
{
|
||||
err+= add_begin_parenthesis(fptr);
|
||||
i= 0;
|
||||
@@ -1930,10 +1928,11 @@ char *generate_partition_syntax(partition_info *part_info,
|
||||
err+= add_name_string(fptr, part_elem->partition_name);
|
||||
err+= add_space(fptr);
|
||||
err+= add_partition_values(fptr, part_info, part_elem);
|
||||
if (!part_info->is_sub_partitioned())
|
||||
if (!part_info->is_sub_partitioned() ||
|
||||
part_info->use_default_subpartitions)
|
||||
err+= add_partition_options(fptr, part_elem);
|
||||
if (part_info->is_sub_partitioned() &&
|
||||
(write_all || (!part_info->use_default_subpartitions)))
|
||||
(!part_info->use_default_subpartitions))
|
||||
{
|
||||
err+= add_space(fptr);
|
||||
err+= add_begin_parenthesis(fptr);
|
||||
@@ -4378,6 +4377,15 @@ state of p1.
|
||||
my_error(ER_TOO_MANY_PARTITIONS_ERROR, MYF(0));
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
alt_part_info->part_type= tab_part_info->part_type;
|
||||
alt_part_info->subpart_type= tab_part_info->subpart_type;
|
||||
DBUG_ASSERT(!alt_part_info->use_default_partitions);
|
||||
if (alt_part_info->set_up_defaults_for_partitioning(table->file,
|
||||
ULL(0),
|
||||
0))
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
/*
|
||||
Online handling:
|
||||
REORGANIZE PARTITION:
|
||||
|
Reference in New Issue
Block a user