Fix loadsqlplugin lead CurrentResourceOwner to null.
This commit is contained in:
@ -7695,6 +7695,8 @@ void RemoveTempNamespace()
|
|||||||
void LoadSqlPlugin()
|
void LoadSqlPlugin()
|
||||||
{
|
{
|
||||||
if (u_sess->proc_cxt.MyDatabaseId != InvalidOid && DB_IS_CMPT(B_FORMAT) && IsFileExisted(DOLPHIN)) {
|
if (u_sess->proc_cxt.MyDatabaseId != InvalidOid && DB_IS_CMPT(B_FORMAT) && IsFileExisted(DOLPHIN)) {
|
||||||
|
/* start_xact_command will change CurrentResourceOwner, so save it here */
|
||||||
|
ResourceOwner save = t_thrd.utils_cxt.CurrentResourceOwner;
|
||||||
if (!u_sess->attr.attr_sql.dolphin &&
|
if (!u_sess->attr.attr_sql.dolphin &&
|
||||||
#ifdef ENABLE_LITE_MODE
|
#ifdef ENABLE_LITE_MODE
|
||||||
u_sess->attr.attr_common.upgrade_mode == 0
|
u_sess->attr.attr_common.upgrade_mode == 0
|
||||||
@ -7724,6 +7726,7 @@ void LoadSqlPlugin()
|
|||||||
PG_CATCH();
|
PG_CATCH();
|
||||||
{
|
{
|
||||||
pthread_mutex_unlock(&g_instance.loadPluginLock[DB_CMPT_B]);
|
pthread_mutex_unlock(&g_instance.loadPluginLock[DB_CMPT_B]);
|
||||||
|
t_thrd.utils_cxt.CurrentResourceOwner = save;
|
||||||
PG_RE_THROW();
|
PG_RE_THROW();
|
||||||
}
|
}
|
||||||
PG_END_TRY();
|
PG_END_TRY();
|
||||||
@ -7731,6 +7734,7 @@ void LoadSqlPlugin()
|
|||||||
} else if (u_sess->attr.attr_sql.dolphin) {
|
} else if (u_sess->attr.attr_sql.dolphin) {
|
||||||
InitBSqlPluginHookIfNeeded();
|
InitBSqlPluginHookIfNeeded();
|
||||||
}
|
}
|
||||||
|
t_thrd.utils_cxt.CurrentResourceOwner = save;
|
||||||
} else if (u_sess->proc_cxt.MyDatabaseId != InvalidOid && DB_IS_CMPT(A_FORMAT) && u_sess->attr.attr_sql.whale) {
|
} else if (u_sess->proc_cxt.MyDatabaseId != InvalidOid && DB_IS_CMPT(A_FORMAT) && u_sess->attr.attr_sql.whale) {
|
||||||
InitASqlPluginHookIfNeeded();
|
InitASqlPluginHookIfNeeded();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user