diff options
author | Igor Babaev <igor@askmonty.org> | 2016-08-31 16:16:54 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2016-08-31 16:16:54 -0700 |
commit | 3fb4f9bb93868ce5c7e385d0545c00755d8e23bd (patch) | |
tree | 8ea1c005920b2ef9d7c7f1114c5433c728751b72 /sql/item_cmpfunc.cc | |
parent | 670760d504bebdf542df890f4d40f4cd3ff7a2c8 (diff) | |
parent | eb2c1474752a5f743db638d5b06612c9e3f07f74 (diff) | |
download | mariadb-git-3fb4f9bb93868ce5c7e385d0545c00755d8e23bd.tar.gz |
Merge branch '10.2-mdev9197-cons' of github.com:shagalla/server
into branch 10.2-mdev9197.
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 eafb6b1c91b..92fe5f2c474 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 @@ -4856,6 +4859,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); |