summaryrefslogtreecommitdiff
path: root/sql/item_row.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-03-30 11:12:56 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-03-30 11:12:56 +0300
commit1a9b6c4c7f817155f5ce8b1a6062d0eccbfd10ec (patch)
treec1da70f7f990dae02c5dfe70fd75299ced68873c /sql/item_row.cc
parent0fb84216a35046a4574dec214dcce03130a797c1 (diff)
parentb11ff3d49581d9e7b6f8b990f08e85e4d6384418 (diff)
downloadmariadb-git-1a9b6c4c7f817155f5ce8b1a6062d0eccbfd10ec.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/item_row.cc')
-rw-r--r--sql/item_row.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 70a9fe50c16..04868842f11 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -1,5 +1,6 @@
/*
Copyright (c) 2002, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2011, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -165,16 +166,20 @@ void Item_row::bring_value()
Item* Item_row::build_clone(THD *thd)
{
- Item_row *copy= (Item_row *) get_copy(thd);
- if (!copy)
+ Item **copy_args= static_cast<Item**>
+ (alloc_root(thd->mem_root, sizeof(Item*) * arg_count));
+ if (unlikely(!copy_args))
return 0;
- copy->args= (Item**) alloc_root(thd->mem_root, sizeof(Item*) * arg_count);
for (uint i= 0; i < arg_count; i++)
{
Item *arg_clone= args[i]->build_clone(thd);
if (!arg_clone)
return 0;
- copy->args[i]= arg_clone;
+ copy_args[i]= arg_clone;
}
+ Item_row *copy= (Item_row *) get_copy(thd);
+ if (unlikely(!copy))
+ return 0;
+ copy->args= copy_args;
return copy;
}