diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-30 14:50:23 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-30 14:50:23 +0300 |
commit | e2f1f88fa60680cb87833a7cceb172f5d436a804 (patch) | |
tree | 5e48f8ed5c7a169af6692c72de9f1007af48737e /sql/item_row.cc | |
parent | 9eae063e79376fd71586e1106e750a366467a984 (diff) | |
parent | b092d35f13ceae37cda26478635b127f9b401e2c (diff) | |
download | mariadb-git-e2f1f88fa60680cb87833a7cceb172f5d436a804.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'sql/item_row.cc')
-rw-r--r-- | sql/item_row.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/item_row.cc b/sql/item_row.cc index 150d57263b6..a363f9b5576 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; } |