From 58bc867ca17b85d2447fe25835787d58bea2c73c Mon Sep 17 00:00:00 2001 From: Ravi Prakash Date: Thu, 30 Aug 2018 20:24:24 -0700 Subject: [PATCH] MCOL-1188 assertion 'fColumn.get() && fSub && fFunc' failed, ... MySQL server crashed. The problem was in processing a subquery in the where clause that was categorized as a CACHE_ITEM in the parse tree. The fix involved how we walk the parse tree in gp_walk(). --- dbcon/mysql/ha_calpont_execplan.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/dbcon/mysql/ha_calpont_execplan.cpp b/dbcon/mysql/ha_calpont_execplan.cpp index 42d26108c..47f07c67b 100755 --- a/dbcon/mysql/ha_calpont_execplan.cpp +++ b/dbcon/mysql/ha_calpont_execplan.cpp @@ -4096,15 +4096,17 @@ void gp_walk(const Item *item, void *arg) if (itype == Item::FUNC_ITEM && ((Item_func*)item)->functype() == Item_func::XOR_FUNC ) itype = Item::COND_ITEM; - if(item->type() == Item::CACHE_ITEM) - { - item = ((Item_cache*)item)->get_example(); - itype = item->type(); - isCached = true; - } - switch (itype) { + case Item::CACHE_ITEM: + { + // The item or condition is cached as per MariaDB server view but + // for InfiniDB it need to be executed. + // MCOL-1188 and + Item* orig_item = ((Item_cache*)item)->get_example(); + orig_item->traverse_cond(gp_walk, gwip, Item::POSTFIX); + break; + } case Item::FIELD_ITEM: { Item_field* ifp = (Item_field*)item;