diff --git a/src/common/backend/parser/parse_func.cpp b/src/common/backend/parser/parse_func.cpp index bdb6becdd3231c13cc3bcf661de0f691f1895c9b..41eaf99064f8b4f8229ec7a6a613d53c6713997a 100644 --- a/src/common/backend/parser/parse_func.cpp +++ b/src/common/backend/parser/parse_func.cpp @@ -1157,20 +1157,21 @@ FuncCandidateList func_select_candidate(int nargs, Oid* input_typeids, FuncCandi * Run through all candidates and keep those with the most matches on * exact types. Keep all candidates if none match. */ - for (i = 0; i < nargs; i++) /* avoid multiple lookups */ - { - slot_category[i] = TypeCategory(input_base_typeids[i]); - /* - * For C, we should choose numeric + numeric for varchar + int, - * so we should also admit highest type conversion for operations - * between different type categories - */ - if ((u_sess->attr.attr_sql.sql_compatibility == C_FORMAT || u_sess->attr.attr_sql.transform_to_numeric_operators) - && !different_category && slot_category[i] != TYPCATEGORY_UNKNOWN) { - if (current_category == TYPCATEGORY_INVALID) - current_category = slot_category[i]; - else if (slot_category[i] != current_category) - different_category = true; + if (u_sess->attr.attr_sql.sql_compatibility == C_FORMAT || u_sess->attr.attr_sql.transform_to_numeric_operators) { + /* avoid multiple lookups */ + for (i = 0; i < nargs; i++) { + slot_category[i] = TypeCategory(input_base_typeids[i]); + /* + * For C, we should choose numeric + numeric for varchar + int, + * so we should also admit highest type conversion for operations + * between different type categories + */ + if (!different_category && slot_category[i] != TYPCATEGORY_UNKNOWN) { + if (current_category == TYPCATEGORY_INVALID) + current_category = slot_category[i]; + else if (slot_category[i] != current_category) + different_category = true; + } } } diff --git a/src/gausskernel/process/tcop/postgres.cpp b/src/gausskernel/process/tcop/postgres.cpp index 51ce50be63a97dc2580e15600c239e91d1eebefd..e57c0c785deec69265d6df0b0fd5b988f8eba098 100755 --- a/src/gausskernel/process/tcop/postgres.cpp +++ b/src/gausskernel/process/tcop/postgres.cpp @@ -7774,7 +7774,6 @@ void LoadSqlPlugin() if (!u_sess->attr.attr_sql.dolphin) { LoadDolphinIfNeeded(); } - InitBSqlPluginHookIfNeeded(); } PG_CATCH(); { @@ -7786,6 +7785,7 @@ void LoadSqlPlugin() PG_END_TRY(); pthread_mutex_unlock(&g_instance.loadPluginLock[DB_CMPT_B]); t_thrd.utils_cxt.holdLoadPluginLock[DB_CMPT_B] = false; + InitBSqlPluginHookIfNeeded(); } else if (u_sess->attr.attr_sql.dolphin) { InitBSqlPluginHookIfNeeded(); }