Fix load plugin bug.

This commit is contained in:
totaj
2022-12-07 10:12:07 +08:00
parent 93107e0d21
commit 8da08b573d

View File

@ -7474,6 +7474,8 @@ void LoadSqlPlugin()
/* recheck and load dolphin within lock */
pthread_mutex_lock(&g_instance.loadPluginLock[DB_CMPT_B]);
PG_TRY();
{
start_xact_command();
u_sess->attr.attr_sql.dolphin = CheckIfExtensionExists("dolphin");
finish_xact_command();
@ -7481,6 +7483,13 @@ void LoadSqlPlugin()
if (!u_sess->attr.attr_sql.dolphin) {
LoadDolphinIfNeeded();
}
}
PG_CATCH();
{
pthread_mutex_unlock(&g_instance.loadPluginLock[DB_CMPT_B]);
PG_RE_THROW();
}
PG_END_TRY();
pthread_mutex_unlock(&g_instance.loadPluginLock[DB_CMPT_B]);
} else if (u_sess->attr.attr_sql.dolphin) {
InitBSqlPluginHookIfNeeded();