summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-09-19 09:47:08 +0200
committerSergei Golubchik <serg@mariadb.org>2016-09-19 09:47:08 +0200
commitf9bdc7c01af52c04a05b5d0e890f86c77323d3b0 (patch)
tree09779236c1d7061fb1706524c2e3b357369eae8e /sql/item_cmpfunc.cc
parentf7be8cf2854fc0c2871c1537e60b1d7cb1931a61 (diff)
parentf566a4f83c8c255e0192afa525fdeb0897927167 (diff)
downloadmariadb-git-f9bdc7c01af52c04a05b5d0e890f86c77323d3b0.tar.gz
Merge branch '10.2' into bb-10.2-jan
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index eafb6b1c91b..434442cffa9 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -4856,6 +4856,43 @@ void Item_cond::neg_arguments(THD *thd)
}
+/**
+ @brief
+ Building clone for Item_cond
+
+ @param thd thread handle
+ @param mem_root part of the memory for the clone
+
+ @details
+ This method gets copy of the current item and also
+ build clones for its elements. For this elements
+ build_copy is called again.
+
+ @retval
+ clone of the item
+ 0 if an error occured
+*/
+
+Item *Item_cond::build_clone(THD *thd, MEM_ROOT *mem_root)
+{
+ List_iterator_fast<Item> li(list);
+ Item *item;
+ Item_cond *copy= (Item_cond *) get_copy(thd, mem_root);
+ if (!copy)
+ return 0;
+ copy->list.empty();
+ while ((item= li++))
+ {
+ Item *arg_clone= item->build_clone(thd, mem_root);
+ if (!arg_clone)
+ return 0;
+ if (copy->list.push_back(arg_clone, mem_root))
+ return 0;
+ }
+ return copy;
+}
+
+
void Item_cond_and::mark_as_condition_AND_part(TABLE_LIST *embedding)
{
List_iterator<Item> li(list);