diff options
author | Galina Shalygina <galashalygina@gmail.com> | 2016-05-01 22:29:47 +0300 |
---|---|---|
committer | Galina Shalygina <galashalygina@gmail.com> | 2016-08-23 00:39:12 +0300 |
commit | eb2c1474752a5f743db638d5b06612c9e3f07f74 (patch) | |
tree | 2cbdafbe8617bf72f8addf3cfcdd53b10c7cbe8e /sql/item_cmpfunc.cc | |
parent | 8b94aec11af19fc711ed48f13410986814bc51a0 (diff) | |
download | mariadb-git-eb2c1474752a5f743db638d5b06612c9e3f07f74.tar.gz |
The consolidated patch for mdev-9197.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 40 |
1 files changed, 40 insertions, 0 deletions
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<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); |