1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +03:00

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.
This commit is contained in:
Andrew Hutchings
2018-11-21 11:23:12 +00:00
parent 410734821b
commit f3ce33d9ea

View File

@@ -3813,7 +3813,7 @@ FunctionColumn* buildCaseFunction(Item_func* item, gp_walk_info& gwi, bool& nonS
FuncExp* funcexp = FuncExp::instance(); FuncExp* funcexp = FuncExp::instance();
string funcName = "case_simple"; 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"; 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. // some cpu cycles trying to build a ReturnedColumn as below.
// Every even numbered arg is a WHEN. In between are the THEN. // 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. // 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)) (i < arg_offset))
{ {
// MCOL-1472 Nested CASE with an ISNULL predicate. We don't want the predicate // MCOL-1472 Nested CASE with an ISNULL predicate. We don't want the predicate