diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-01-29 15:41:05 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-01-29 15:41:05 +0100 |
commit | 41a163ac5ccf4ac5394edc84e40b3f47acea6b08 (patch) | |
tree | 60d5259e290b4a0166d8ef1651975b14b5afe304 /sql/partition_info.cc | |
parent | a85d942be9008cf19086d8bd330c4be83a18167f (diff) | |
parent | e2b50213cf12623da31c8b49be4d40772876223c (diff) | |
download | mariadb-git-41a163ac5ccf4ac5394edc84e40b3f47acea6b08.tar.gz |
Merge branch '10.2' into 10.3mariadb-10.3.33
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r-- | sql/partition_info.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 163fb9c214d..edcdd6d2b37 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -40,7 +40,7 @@ #include "ha_partition.h" -partition_info *partition_info::get_clone(THD *thd) +partition_info *partition_info::get_clone(THD *thd, bool empty_data_and_index_file) { MEM_ROOT *mem_root= thd->mem_root; DBUG_ENTER("partition_info::get_clone"); @@ -60,21 +60,22 @@ partition_info *partition_info::get_clone(THD *thd) { List_iterator<partition_element> subpart_it(part->subpartitions); partition_element *subpart; - partition_element *part_clone= new (mem_root) partition_element(); + partition_element *part_clone= new (mem_root) partition_element(*part); if (!part_clone) DBUG_RETURN(NULL); - - *part_clone= *part; part_clone->subpartitions.empty(); while ((subpart= (subpart_it++))) { - partition_element *subpart_clone= new (mem_root) partition_element(); + partition_element *subpart_clone= new (mem_root) partition_element(*subpart); if (!subpart_clone) DBUG_RETURN(NULL); - - *subpart_clone= *subpart; + if (empty_data_and_index_file) + subpart_clone->data_file_name= subpart_clone->index_file_name= NULL; part_clone->subpartitions.push_back(subpart_clone, mem_root); } + + if (empty_data_and_index_file) + part_clone->data_file_name= part_clone->index_file_name= NULL; clone->partitions.push_back(part_clone, mem_root); part_clone->list_val_list.empty(); List_iterator<part_elem_value> list_val_it(part->list_val_list); |