From f3ce33d9ea585fcaee41ddeb37014227d3ba5f0e Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Wed, 21 Nov 2018 11:23:12 +0000 Subject: [PATCH] MCOL-1790 Switch to MariaDB's case type detection MariaDB added a generic way to detect case type so remove our hack and switch to that. --- dbcon/mysql/ha_calpont_execplan.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbcon/mysql/ha_calpont_execplan.cpp b/dbcon/mysql/ha_calpont_execplan.cpp index a872ace4f..e048d5f34 100644 --- a/dbcon/mysql/ha_calpont_execplan.cpp +++ b/dbcon/mysql/ha_calpont_execplan.cpp @@ -3813,7 +3813,7 @@ FunctionColumn* buildCaseFunction(Item_func* item, gp_walk_info& gwi, bool& nonS FuncExp* funcexp = FuncExp::instance(); string funcName = "case_simple"; - if (strcasecmp(((Item_func_case*)item)->case_type(), "searched") == 0) + if (item->functype() == Item_func::CASE_SEARCHED_FUNC) { funcName = "case_searched"; } @@ -3857,7 +3857,7 @@ FunctionColumn* buildCaseFunction(Item_func* item, gp_walk_info& gwi, bool& nonS // some cpu cycles trying to build a ReturnedColumn as below. // Every even numbered arg is a WHEN. In between are the THEN. // An odd number of args indicates an ELSE residing in the last spot. - if (funcName == "case_searched" && + if ((item->functype() == Item_func::CASE_SEARCHED_FUNC) && (i < arg_offset)) { // MCOL-1472 Nested CASE with an ISNULL predicate. We don't want the predicate