bugfix: change kernel to support some third-party extensions

This commit is contained in:
chenlinfeng3 2020-07-29 10:27:41 +08:00
parent 53626285eb
commit 105e6ccb68
1 changed files with 0 additions and 36 deletions

View File

@ -3586,9 +3586,6 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi
} break;
case T_AlterDomainStmt:
#ifdef PGXC
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("domain is not yet supported.")));
#endif /* PGXC */
{
AlterDomainStmt* stmt = (AlterDomainStmt*)parse_tree;
@ -4240,10 +4237,6 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi
} break;
case T_RuleStmt: /* CREATE RULE */
#ifdef PGXC
if (!IsInitdb && !u_sess->attr.attr_sql.enable_cluster_resize && !u_sess->exec_cxt.extension_is_valid)
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("RULE is not yet supported.")));
#endif /* PGXC */
DefineRule((RuleStmt*)parse_tree, query_string);
#ifdef PGXC
if (IS_PGXC_COORDINATOR && !IsConnFromCoord()) {
@ -4927,10 +4920,6 @@ void standard_ProcessUtility(Node* parse_tree, const char* query_string, ParamLi
* ******************************** DOMAIN statements ****
*/
case T_CreateDomainStmt:
#ifdef PGXC
if (!IsInitdb && !u_sess->attr.attr_common.IsInplaceUpgrade)
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("domain is not yet supported.")));
#endif /* PGXC */
DefineDomain((CreateDomainStmt*)parse_tree);
#ifdef PGXC
if (IS_PGXC_COORDINATOR)
@ -8531,9 +8520,6 @@ void CheckObjectInBlackList(ObjectType obj_type, const char* query_string)
return;
else
break;
case OBJECT_AGGREGATE:
tag = "AGGREGATE";
break;
case OBJECT_OPERATOR:
tag = "OPERATOR";
break;
@ -8596,28 +8582,6 @@ void CheckObjectInBlackList(ObjectType obj_type, const char* query_string)
*/
bool CheckExtensionInWhiteList(const char* extension_name, uint32 hash_value, bool hash_check)
{
/* 2902411162 hash for fastcheck, the sql file is much shorter than published version. */
uint32 postgisHashHistory[POSTGIS_VERSION_NUM] = {2902411162, 2959454932};
/* check for extension name */
if (pg_strcasecmp(extension_name, "postgis") == 0) {
/* PostGIS is disabled under 300 deployment */
if (is_feature_disabled(POSTGIS_DOCKING)) {
return false;
}
if (hash_check && !isSecurityMode) {
/* check for postgis hashvalue */
for (int i = 0; i < POSTGIS_VERSION_NUM; i++) {
if (hash_value == postgisHashHistory[i]) {
return true;
}
}
} else {
return true;
}
}
return true;
}