summaryrefslogtreecommitdiff
path: root/sql/partition_info.cc
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2017-08-15 14:30:27 +0300
committerSergei Golubchik <serg@mariadb.org>2017-11-22 12:52:16 +0100
commit37dd3cf424d7951d47928992093b4d145575c45a (patch)
tree8bcf455eb6133588b01e1d2087e0a6bec2d28d92 /sql/partition_info.cc
parent3422ceb10cba9e5ab122ebb15478b199963fcc48 (diff)
downloadmariadb-git-37dd3cf424d7951d47928992093b4d145575c45a.tar.gz
MDEV-13550 Copy ctor instread of memcpy() in partition_info::get_clone() (#436)
List<>::last is wrong after memcpy(). Doing it on constructed objects is bad practice.
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r--sql/partition_info.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index c2bc530117f..656a89d8706 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -42,13 +42,12 @@ partition_info *partition_info::get_clone(THD *thd)
List_iterator<partition_element> part_it(partitions);
partition_element *part;
- partition_info *clone= new (mem_root) partition_info();
+ partition_info *clone= new (mem_root) partition_info(*this);
if (!clone)
{
mem_alloc_error(sizeof(partition_info));
DBUG_RETURN(NULL);
}
- memcpy(clone, this, sizeof(partition_info));
memset(&(clone->read_partitions), 0, sizeof(clone->read_partitions));
memset(&(clone->lock_partitions), 0, sizeof(clone->lock_partitions));
clone->bitmaps_are_initialized= FALSE;