summaryrefslogtreecommitdiff
path: root/sql/item_row.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_row.cc')
-rw-r--r--sql/item_row.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 000253ece07..6ae049dbfe5 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -166,17 +166,20 @@ void Item_row::bring_value()
Item* Item_row::build_clone(THD *thd, MEM_ROOT *mem_root)
{
- Item_row *copy= (Item_row *) get_copy(thd, mem_root);
- if (!copy)
+ Item **copy_args= 0;
+ if (!(copy_args= (Item**) alloc_root(mem_root, sizeof(Item*) * arg_count)))
return 0;
- copy->args= (Item**) alloc_root(mem_root, sizeof(Item*) * arg_count);
for (uint i= 0; i < arg_count; i++)
{
Item *arg_clone= args[i]->build_clone(thd, mem_root);
if (!arg_clone)
return 0;
- copy->args[i]= arg_clone;
+ copy_args[i]= arg_clone;
}
+ Item_row *copy= (Item_row *) get_copy(thd, mem_root);
+ if (!copy)
+ return 0;
+ copy->args= copy_args;
return copy;
}