From 16d32d3978364f7982e56be6c7254f782b6f3772 Mon Sep 17 00:00:00 2001 From: ganyang Date: Thu, 12 May 2022 14:30:24 +0800 Subject: [PATCH] rename b_sql_plugin --- src/common/backend/catalog/pg_builtin_proc.cpp | 6 +++--- src/common/backend/utils/init/postinit.cpp | 4 ++-- src/common/pl/plpgsql/src/gram.y | 2 +- src/gausskernel/optimizer/commands/extension.cpp | 6 +++--- src/gausskernel/process/tcop/postgres.cpp | 8 ++++---- src/gausskernel/process/threadpool/threadpool_worker.cpp | 2 +- src/include/knl/knl_guc/knl_session_attr_sql.h | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/common/backend/catalog/pg_builtin_proc.cpp b/src/common/backend/catalog/pg_builtin_proc.cpp index 33f5e3732..5e30b493b 100755 --- a/src/common/backend/catalog/pg_builtin_proc.cpp +++ b/src/common/backend/catalog/pg_builtin_proc.cpp @@ -52,7 +52,7 @@ static_assert(sizeof(false) == sizeof(char), "illegal bool size"); static struct HTAB* nameHash = NULL; static struct HTAB* oidHash = NULL; -/* for b_sql_plugin */ +/* for dolphin */ struct HTAB* b_nameHash = NULL; struct HTAB* b_oidHash = NULL; @@ -118,7 +118,7 @@ static const FuncGroup* NameHashTableAccess(HASHACTION action, const char* name, Assert(name != NULL); - if (DB_IS_CMPT(B_FORMAT) && b_nameHash != NULL && u_sess->attr.attr_sql.b_sql_plugin) { + if (DB_IS_CMPT(B_FORMAT) && b_nameHash != NULL && u_sess->attr.attr_sql.dolphin) { result = (HashEntryNameToFuncGroup *)hash_search(b_nameHash, &temp_name, action, &found); } else { result = (HashEntryNameToFuncGroup *)hash_search(nameHash, &temp_name, action, &found); @@ -144,7 +144,7 @@ static const Builtin_func* OidHashTableAccess(HASHACTION action, Oid oid, const bool found = false; Assert(oid > 0); - if (DB_IS_CMPT(B_FORMAT) && b_oidHash != NULL && u_sess->attr.attr_sql.b_sql_plugin) { + if (DB_IS_CMPT(B_FORMAT) && b_oidHash != NULL && u_sess->attr.attr_sql.dolphin) { result = (HashEntryOidToBuiltinFunc *)hash_search(b_oidHash, &oid, action, &found); } else { result = (HashEntryOidToBuiltinFunc *)hash_search(oidHash, &oid, action, &found); diff --git a/src/common/backend/utils/init/postinit.cpp b/src/common/backend/utils/init/postinit.cpp index b84e9f23d..32625fee1 100644 --- a/src/common/backend/utils/init/postinit.cpp +++ b/src/common/backend/utils/init/postinit.cpp @@ -2712,8 +2712,8 @@ void PostgresInitializer::InitExtensionVariable() } /* check whether the extension has been created */ - const char* b_sql_plugin = "b_sql_plugin"; - u_sess->attr.attr_sql.b_sql_plugin = CheckIfExtensionExists(b_sql_plugin); + const char* dolphin = "dolphin"; + u_sess->attr.attr_sql.dolphin = CheckIfExtensionExists(dolphin); } void PostgresInitializer::FinishInit() diff --git a/src/common/pl/plpgsql/src/gram.y b/src/common/pl/plpgsql/src/gram.y index a5ba9ac5f..156573bd6 100755 --- a/src/common/pl/plpgsql/src/gram.y +++ b/src/common/pl/plpgsql/src/gram.y @@ -10342,7 +10342,7 @@ check_sql_expr(const char *stmt, int location, int leaderlen) u_sess->plsql_cxt.plpgsql_yylloc = plpgsql_yylloc; RawParserHook parser_hook= raw_parser; #ifndef ENABLE_MULTIPLE_NODES - if (u_sess->attr.attr_sql.b_sql_plugin) { + if (u_sess->attr.attr_sql.dolphin) { int id = GetCustomParserId(); if (id >= 0 && g_instance.raw_parser_hook[id] != NULL) { parser_hook = (RawParserHook)g_instance.raw_parser_hook[id]; diff --git a/src/gausskernel/optimizer/commands/extension.cpp b/src/gausskernel/optimizer/commands/extension.cpp index 9e4dbf546..4eff486bb 100644 --- a/src/gausskernel/optimizer/commands/extension.cpp +++ b/src/gausskernel/optimizer/commands/extension.cpp @@ -1175,7 +1175,7 @@ void CreateExtension(CreateExtensionStmt* stmt) FEATURE_NOT_PUBLIC_ERROR("EXTENSION is not yet supported."); } - if (pg_strcasecmp(stmt->extname, "b_sql_plugin") == 0 && !DB_IS_CMPT(B_FORMAT)) { + if (pg_strcasecmp(stmt->extname, "dolphin") == 0 && !DB_IS_CMPT(B_FORMAT)) { ereport(ERROR, (errmsg("please create extension \"%s\" with B type DBCOMPATIBILITY", stmt->extname))); } @@ -1418,8 +1418,8 @@ void CreateExtension(CreateExtensionStmt* stmt) u_sess->exec_cxt.extension_is_valid = true; - if (pg_strcasecmp(stmt->extname, "b_sql_plugin") == 0) { - u_sess->attr.attr_sql.b_sql_plugin = true; + if (pg_strcasecmp(stmt->extname, "dolphin") == 0) { + u_sess->attr.attr_sql.dolphin = true; } /* diff --git a/src/gausskernel/process/tcop/postgres.cpp b/src/gausskernel/process/tcop/postgres.cpp index 020659a7b..04ac21d15 100755 --- a/src/gausskernel/process/tcop/postgres.cpp +++ b/src/gausskernel/process/tcop/postgres.cpp @@ -825,10 +825,10 @@ void client_read_ended(void) #define INIT_PLUGIN_OBJECT "init_plugin_object" void InitBSqlPluginHookIfNeeded() { - const char* b_sql_plugin = "b_sql_plugin"; + const char* dolphin = "dolphin"; CFunInfo tmpCF; - tmpCF = load_external_function(b_sql_plugin, INIT_PLUGIN_OBJECT, false, false); + tmpCF = load_external_function(dolphin, INIT_PLUGIN_OBJECT, false, false); if (tmpCF.user_fn != NULL) { ((void* (*)(void))(tmpCF.user_fn))(); } @@ -862,7 +862,7 @@ List* pg_parse_query(const char* query_string, List** query_string_locationlist) List* (*parser_hook)(const char*, List**) = raw_parser; #ifndef ENABLE_MULTIPLE_NODES - if (u_sess->attr.attr_sql.b_sql_plugin) { + if (u_sess->attr.attr_sql.dolphin) { int id = GetCustomParserId(); if (id >= 0 && g_instance.raw_parser_hook[id] != NULL) { parser_hook = (List* (*)(const char*, List**))g_instance.raw_parser_hook[id]; @@ -7574,7 +7574,7 @@ int PostgresMain(int argc, char* argv[], const char* dbname, const char* usernam init_set_params_htab(); #ifndef ENABLE_MULTIPLE_NODES - if (u_sess->proc_cxt.MyDatabaseId != InvalidOid && DB_IS_CMPT(B_FORMAT) && u_sess->attr.attr_sql.b_sql_plugin) { + if (u_sess->proc_cxt.MyDatabaseId != InvalidOid && DB_IS_CMPT(B_FORMAT) && u_sess->attr.attr_sql.dolphin) { InitBSqlPluginHookIfNeeded(); } #endif diff --git a/src/gausskernel/process/threadpool/threadpool_worker.cpp b/src/gausskernel/process/threadpool/threadpool_worker.cpp index bd4964502..ac92f6a8c 100644 --- a/src/gausskernel/process/threadpool/threadpool_worker.cpp +++ b/src/gausskernel/process/threadpool/threadpool_worker.cpp @@ -848,7 +848,7 @@ static bool InitSession(knl_session_context* session) t_thrd.proc_cxt.PostInit->InitSession(); #ifndef ENABLE_MULTIPLE_NODES - if (u_sess->proc_cxt.MyDatabaseId != InvalidOid && DB_IS_CMPT(B_FORMAT) && u_sess->attr.attr_sql.b_sql_plugin) { + if (u_sess->proc_cxt.MyDatabaseId != InvalidOid && DB_IS_CMPT(B_FORMAT) && u_sess->attr.attr_sql.dolphin) { InitBSqlPluginHookIfNeeded(); } #endif diff --git a/src/include/knl/knl_guc/knl_session_attr_sql.h b/src/include/knl/knl_guc/knl_session_attr_sql.h index 155bb0547..9d252ea0c 100644 --- a/src/include/knl/knl_guc/knl_session_attr_sql.h +++ b/src/include/knl/knl_guc/knl_session_attr_sql.h @@ -238,7 +238,7 @@ typedef struct knl_session_attr_sql { #ifndef ENABLE_MULTIPLE_NODES bool enable_custom_parser; #endif - bool b_sql_plugin; + bool dolphin; } knl_session_attr_sql; #endif /* SRC_INCLUDE_KNL_KNL_SESSION_ATTR_SQL */