From c01e1f4ed8d2dc88f706462d770a1bd5bd169180 Mon Sep 17 00:00:00 2001 From: Sergey Zefirov <72864488+mariadb-SergeyZefirov@users.noreply.github.com> Date: Mon, 11 Mar 2024 18:17:46 +0300 Subject: [PATCH] Use of newly introduced schema-based name resolution for (#3138) Oracle-compatible functions Server changed the way to resolve functions' names and we need to adapt. --- dbcon/mysql/ha_mcs_execplan.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dbcon/mysql/ha_mcs_execplan.cpp b/dbcon/mysql/ha_mcs_execplan.cpp index a31f63d22..75e3acbbe 100644 --- a/dbcon/mysql/ha_mcs_execplan.cpp +++ b/dbcon/mysql/ha_mcs_execplan.cpp @@ -3883,6 +3883,17 @@ ReturnedColumn* buildFunctionColumn(Item_func* ifp, gp_walk_info& gwi, bool& non cal_connection_info* ci = static_cast(get_fe_conn_info_ptr()); string funcName = ifp->func_name(); + const Schema* funcSchema = ifp->schema(); + if (funcSchema) + { + idbassert(funcSchema->name().str); + string funcSchemaName(funcSchema->name().str, funcSchema->name().length); + if (funcSchemaName == "oracle_schema") + { + // XXX: this is a shortcut. + funcName = funcName + "_oracle"; + } + } FuncExp* funcExp = FuncExp::instance(); Func* functor; FunctionColumn* fc = NULL;