From 3cd4d8ddba69131f26f3773684d4a6c489063fdf Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 17 Sep 2020 16:08:23 +0200 Subject: [PATCH] parser optimization first try to resolve the function name as a native function, and only then look within pluggable data types --- sql/sql_yacc.yy | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 088e99f25c0..ed361ed5df4 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -10594,19 +10594,20 @@ function_call_generic: names are resolved with the following order: - MySQL native functions, - User Defined Functions, + - Constructors, like POINT(1,1) - Stored Functions (assuming the current database) This will be revised with WL#2128 (SQL PATH) */ - if ((h= Type_handler::handler_by_name(thd, $1)) && - (item= h->make_constructor_item(thd, $4))) - { - // Found a constructor with a proper argument count - } - else if ((builder= find_native_function_builder(thd, &$1))) + if ((builder= find_native_function_builder(thd, &$1))) { item= builder->create_func(thd, &$1, $4); } + else if ((h= Type_handler::handler_by_name(thd, $1)) && + (item= h->make_constructor_item(thd, $4))) + { + // Found a constructor with a proper argument count + } else { #ifdef HAVE_DLOPEN