Commit 14e1d69a authored by unknown's avatar unknown

BUG#19067: Crash for default subpartitioning when altering the table


mysql-test/r/information_schema_part.result:
  Bug fix
sql/partition_element.h:
  Review fixes
sql/sql_partition.cc:
  Review fixes
parent dabe8397
......@@ -119,7 +119,7 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10) )
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM)
select SUBPARTITION_METHOD FROM information_schema.partitions WHERE
table_schema="test" AND table_name="t1";
SUBPARTITION_METHOD
......
......@@ -64,24 +64,20 @@ class partition_element :public Sql_alloc {
engine_type(NULL),part_state(PART_NORMAL),
nodegroup_id(UNDEF_NODEGROUP), has_null_value(FALSE)
{
subpartitions.empty();
list_val_list.empty();
}
partition_element(partition_element *part_elem)
: partition_name(NULL), range_value(0), has_null_value(FALSE)
: part_max_rows(part_elem->part_max_rows),
part_min_rows(part_elem->part_min_rows),
partition_name(NULL),
tablespace_name(part_elem->tablespace_name),
range_value(0), part_comment(part_elem->part_comment),
data_file_name(part_elem->data_file_name),
index_file_name(part_elem->index_file_name),
engine_type(part_elem->engine_type),
part_state(part_elem->part_state),
nodegroup_id(part_elem->nodegroup_id),
has_null_value(FALSE)
{
subpartitions.empty();
list_val_list.empty();
part_max_rows= part_elem->part_max_rows;
part_min_rows= part_elem->part_min_rows;
tablespace_name= part_elem->tablespace_name;
part_comment= part_elem->part_comment;
data_file_name= part_elem->data_file_name;
index_file_name= part_elem->index_file_name;
engine_type= part_elem->engine_type;
part_state= part_elem->part_state;
nodegroup_id= part_elem->nodegroup_id;
}
~partition_element() {}
};
......@@ -1886,9 +1886,10 @@ char *generate_partition_syntax(partition_info *part_info,
err+= add_partition_values(fptr, part_info, part_elem);
if (!part_info->is_sub_partitioned() ||
part_info->use_default_subpartitions)
{
err+= add_partition_options(fptr, part_elem);
if (part_info->is_sub_partitioned() &&
(!part_info->use_default_subpartitions))
}
else
{
err+= add_space(fptr);
err+= add_begin_parenthesis(fptr);
......
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