From eb2c1474752a5f743db638d5b06612c9e3f07f74 Mon Sep 17 00:00:00 2001 From: Galina Shalygina Date: Sun, 1 May 2016 22:29:47 +0300 Subject: The consolidated patch for mdev-9197. --- sql/item_cmpfunc.cc | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'sql/item_cmpfunc.cc') diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 335228c37fa..34416d6422c 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -34,6 +34,9 @@ #include "sql_time.h" // make_truncated_value_warning #include "sql_base.h" // dynamic_column_error_message +#define FULL_EXTRACTION_FL (1 << 6) +#define NO_EXTRACTION_FL (1 << 7) + /** find an temporal type (item) that others will be converted to @@ -4844,6 +4847,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 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 li(list); -- cgit v1.2.1