diff options
author | Debarun Banerjee <debarun.banerjee@oracle.com> | 2015-07-08 10:00:53 +0530 |
---|---|---|
committer | Debarun Banerjee <debarun.banerjee@oracle.com> | 2015-07-08 10:00:53 +0530 |
commit | 359f102ad157adaacc904a1c81f5ddcb9ce3662b (patch) | |
tree | 74e2bdd343b94f54fa4e5ca3297bfb1764d42b56 /sql/partition_info.cc | |
parent | 2ac01ca6606a300dc7c043affccb9f850284a5e7 (diff) | |
download | mariadb-git-359f102ad157adaacc904a1c81f5ddcb9ce3662b.tar.gz |
BUG#16613004 PARTITIONING DDL, CRASH IN FIELD_VARSTRING::CMP_MAX
Problem :
---------
The specific issue reported in this bug is with range/list column
value that is allocated and initialized by evaluating partition
expression(item tree) during execution. After evaluation the range
list value is marked fixed [part_column_list_val]. During next
execution, we don't re-evaluate the expression and use the old value
since it is marked fixed.
Solution :
----------
One way to solve the issue is to mark all column values as not fixed
during clone so that the expression is always re-evaluated once we
attempt partition_info::fix_column_value_functions() after cloning
the part_info object during execution of DDL on partitioned table.
Reviewed-by: Jimmy Yang <Jimmy.Yang@oracle.com>
Reviewed-by: Mattias Jonsson <mattias.jonsson@oracle.com>
RB: 9424
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r-- | sql/partition_info.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 336010cc7dd..a0d09557b81 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -31,7 +31,7 @@ #include "ha_partition.h" -partition_info *partition_info::get_clone() +partition_info *partition_info::get_clone(bool reset /* = false */) { if (!this) return 0; @@ -57,6 +57,26 @@ partition_info *partition_info::get_clone() return NULL; } memcpy(part_clone, part, sizeof(partition_element)); + + /* + Mark that RANGE and LIST values needs to be fixed so that we don't + use old values. fix_column_value_functions would evaluate the values + from Item expression. + */ + if (reset) + { + clone->defined_max_value = false; + List_iterator<part_elem_value> list_it(part_clone->list_val_list); + while (part_elem_value *list_value= list_it++) + { + part_column_list_val *col_val= list_value->col_val_array; + for (uint i= 0; i < num_columns; col_val++, i++) + { + col_val->fixed= 0; + } + } + } + part_clone->subpartitions.empty(); while ((subpart= (subpart_it++))) { |