!2547 修复当配置文件里配置dolphin.b_compatibility_mode为on时无法使用B兼容性数据库的问题

Merge pull request !2547 from chenxiaobin/initDolphinHook
This commit is contained in:
opengauss-bot
2022-12-06 11:37:07 +00:00
committed by Gitee
3 changed files with 7 additions and 12 deletions

View File

@ -115,9 +115,9 @@ static void InitHashTable(int size)
static HTAB* get_name_hash_table_type()
{
#if (!defined(ENABLE_MULTIPLE_NODES)) && (!defined(ENABLE_PRIVATEGAUSS))
if (a_nameHash != NULL && u_sess->attr.attr_sql.whale) {
if (a_nameHash != NULL && DB_IS_CMPT(A_FORMAT)) {
return a_nameHash;
} else if (b_nameHash != NULL && u_sess->attr.attr_sql.dolphin) {
} else if (b_nameHash != NULL && DB_IS_CMPT(B_FORMAT)) {
return b_nameHash;
}
#endif
@ -127,9 +127,9 @@ static HTAB* get_name_hash_table_type()
static HTAB* get_oid_hash_table_type()
{
#if (!defined(ENABLE_MULTIPLE_NODES)) && (!defined(ENABLE_PRIVATEGAUSS))
if (a_oidHash != NULL && u_sess->attr.attr_sql.whale) {
if (a_oidHash != NULL && DB_IS_CMPT(A_FORMAT)) {
return a_oidHash;
} else if (b_oidHash != NULL && u_sess->attr.attr_sql.dolphin) {
} else if (b_oidHash != NULL && DB_IS_CMPT(B_FORMAT)) {
return b_oidHash;
}
#endif

View File

@ -1428,13 +1428,6 @@ void CreateExtension(CreateExtensionStmt* stmt)
u_sess->exec_cxt.extension_is_valid = true;
#if (!defined(ENABLE_MULTIPLE_NODES)) && (!defined(ENABLE_PRIVATEGAUSS))
if (pg_strcasecmp(stmt->extname, "dolphin") == 0) {
u_sess->attr.attr_sql.dolphin = true;
} else if (pg_strcasecmp(stmt->extname, "whale") == 0) {
u_sess->attr.attr_sql.whale = true;
}
#endif
/*
* Insert new tuple into pg_extension, and create dependency entries.
*/
@ -1468,7 +1461,10 @@ void CreateExtension(CreateExtensionStmt* stmt)
u_sess->exec_cxt.extension_is_valid = false;
#if (!defined(ENABLE_MULTIPLE_NODES)) && (!defined(ENABLE_PRIVATEGAUSS))
if (pg_strcasecmp(stmt->extname, "dolphin") == 0) {
u_sess->attr.attr_sql.dolphin = true;
InitBSqlPluginHookIfNeeded();
} else if (pg_strcasecmp(stmt->extname, "whale") == 0) {
u_sess->attr.attr_sql.whale = true;
}
#endif
}

View File

@ -1335,7 +1335,6 @@ typedef struct knl_instance_context {
#ifndef ENABLE_MULTIPLE_NODES
void *raw_parser_hook[DB_CMPT_MAX];
void *plsql_parser_hook[DB_CMPT_MAX];
char *llvmIrFilePath[DB_CMPT_MAX];
pthread_mutex_t loadPluginLock[DB_CMPT_MAX];
#endif