From bb06ac4de4fef4bf76178242b1959a68fd9f3969 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Wed, 9 May 2018 09:47:07 +0100 Subject: [PATCH] Fix another merge error --- dbcon/mysql/ha_calpont_execplan.cpp | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/dbcon/mysql/ha_calpont_execplan.cpp b/dbcon/mysql/ha_calpont_execplan.cpp index fd8ae8922..eab807994 100644 --- a/dbcon/mysql/ha_calpont_execplan.cpp +++ b/dbcon/mysql/ha_calpont_execplan.cpp @@ -5044,8 +5044,14 @@ void gp_walk(const Item* item, void* arg) gwip->clauseType = SELECT; if (col->type() != Item::COND_ITEM) + { rc = buildReturnedColumn(col, *gwip, gwip->fatalParseError); + if ( col->type() == Item::FIELD_ITEM ) + gwip->fatalParseError = false; + } + + SimpleColumn* sc = dynamic_cast(rc); if (sc) @@ -5116,6 +5122,31 @@ void gp_walk(const Item* item, void* arg) Item_func* ifp = (Item_func*)col; gwip->ptWorkStack.push(buildParseTree(ifp, *gwip, gwip->fatalParseError)); } + else if (col->type() == Item::FIELD_ITEM && gwip->clauseType == HAVING) + { + Item_field* ifip = static_cast(col); + std::vector::iterator iter = gwip->havingAggColsItems.begin(); + Item_func_or_sum* isfp = NULL; + + for ( ; iter != gwip->havingAggColsItems.end(); iter++ ) + { + Item* temp_isfp = *iter; + isfp = reinterpret_cast(temp_isfp); + + if ( isfp->type() == Item::SUM_FUNC_ITEM && + isfp->result_field == ifip->field ) + { + ReturnedColumn* rc = buildAggregateColumn(isfp, *gwip); + + if (rc) + gwip->rcWorkStack.push(rc); + + break; + } + } + + break; + } else cando = false;