From a710dff9e1c3147bd494c674602c69d4cf67107e Mon Sep 17 00:00:00 2001 From: Roman Nozdrin Date: Fri, 20 Sep 2019 13:35:49 +0300 Subject: [PATCH] MCOL-2178 CS now can have string literals and functions with literals in projection list of the queries with GROUP BY and ORDER BY. Removed support for Item_equal b/c it is an internal format MDB uses and shouldn't be used outside of MDB's optimizer. --- dbcon/mysql/ha_calpont_execplan.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/dbcon/mysql/ha_calpont_execplan.cpp b/dbcon/mysql/ha_calpont_execplan.cpp index 5e0905596..bb34d1d0e 100644 --- a/dbcon/mysql/ha_calpont_execplan.cpp +++ b/dbcon/mysql/ha_calpont_execplan.cpp @@ -324,6 +324,11 @@ void check_sum_func_item(const Item* item, void* arg) *found = true; } } + else if (item->type() == Item::CONST_ITEM) + { + *found= true; + } + } /*@brief sortItemIsInGrouping- seeks for an item in grouping*/ @@ -356,6 +361,10 @@ bool sortItemIsInGrouping(Item* sort_item, ORDER* groupcol) Item_func *ifp = reinterpret_cast(sort_item); ifp->traverse_cond(check_sum_func_item, &found, Item::POSTFIX); } + else if (sort_item->type() == Item::CONST_ITEM) + { + found= true; + } for (; !found && groupcol; groupcol = groupcol->next) { @@ -2010,7 +2019,7 @@ bool buildPredicateItem(Item_func* ifp, gp_walk_info* gwip) } } } - else if (ifp->functype() == Item_func::MULT_EQUAL_FUNC) + /*else if (ifp->functype() == Item_func::MULT_EQUAL_FUNC) { Item_equal *cur_item_eq = (Item_equal*)ifp; Item *lhs_item, *rhs_item; @@ -2041,7 +2050,7 @@ bool buildPredicateItem(Item_func* ifp, gp_walk_info* gwip) gwip->ptWorkStack.push(pt); } } - } + }*/ else if (ifp->functype() == Item_func::EQUAL_FUNC) { // Convert "a <=> b" to (a = b OR (a IS NULL AND b IS NULL))" @@ -6387,19 +6396,6 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, setError(gwi.thd, ER_INTERNAL_ERROR, gwi.parseErrorText, gwi); return ER_INTERNAL_ERROR; } - - // MCOL-3416 support for EQUAL_COND in MDB >= 10.1 - if (join && join->cond_equal) - { - // TODO MCOL-3416 This must traverse all levels not current_level only - List_iterator li(join->cond_equal->current_level); - Item_equal *cur_item_eq; - while ((cur_item_eq= li++)) - { - cur_item_eq->traverse_cond(gp_walk, &gwi, Item::POSTFIX); - } - } - } else if (join && join->zero_result_cause) {