diff --git a/src/gausskernel/process/tcop/postgres.cpp b/src/gausskernel/process/tcop/postgres.cpp index d862d5f1a..cfe867e63 100755 --- a/src/gausskernel/process/tcop/postgres.cpp +++ b/src/gausskernel/process/tcop/postgres.cpp @@ -827,9 +827,6 @@ void InitBSqlPluginHookIfNeeded() { const char* b_sql_plugin = "b_sql_plugin"; CFunInfo tmpCF; - if (!CheckIfExtensionExists(b_sql_plugin)) { - return; - } tmpCF = load_external_function(b_sql_plugin, INIT_PLUGIN_OBJECT, false, false); if (tmpCF.user_fn != NULL) { @@ -7574,7 +7571,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)) { + if (u_sess->proc_cxt.MyDatabaseId != InvalidOid && DB_IS_CMPT(B_FORMAT) && u_sess->attr.attr_sql.b_sql_plugin) { InitBSqlPluginHookIfNeeded(); } #endif diff --git a/src/gausskernel/process/threadpool/threadpool_worker.cpp b/src/gausskernel/process/threadpool/threadpool_worker.cpp index 47ee1a6e3..bd4964502 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)) { + if (u_sess->proc_cxt.MyDatabaseId != InvalidOid && DB_IS_CMPT(B_FORMAT) && u_sess->attr.attr_sql.b_sql_plugin) { InitBSqlPluginHookIfNeeded(); } #endif