Fixes indentation

grant_parameter_propagation
gurkanindibay 2024-01-17 11:36:38 +03:00
parent 0e05dd3c27
commit 15817ab924
6 changed files with 17 additions and 5 deletions

View File

@ -2074,6 +2074,7 @@ GetDistributeObjectOps(Node *node)
{
return &Database_Grant;
}
#if PG_VERSION_NUM >= PG_VERSION_15
case OBJECT_PARAMETER_ACL:
{

View File

@ -68,6 +68,7 @@ GenerateGrantOnParameterFromAclItem(char *parameterName, AclItem *aclItem)
return queries;
}
/*
* CheckAndAppendQuery checks if the aclItem has the given mode and if it has, it appends the
* corresponding query to the queries list.
@ -92,6 +93,7 @@ CheckAndAppendQuery(List **queries, AclItem *aclItem, Oid granteeOid, char *para
}
}
/*
* CheckPermissionsAndGrants checks if the aclItem has the valid permissions and grants
* for the given modes.
@ -105,7 +107,8 @@ CheckPermissionsAndGrants(AclItem *aclItem, AclMode modes[], int numModes)
for (int i = 0; i < numModes; i++)
{
AclMode mode = modes[i];
if(!(grants & mode) || (permissions & mode)){
if (!(grants & mode) || (permissions & mode))
{
ereport(ERROR, (errmsg("ACL item has no grant option for mode %lu", mode)));
}
}
@ -166,4 +169,6 @@ GrantOnParameters(void)
return commands;
}
#endif /* PG_VERSION_NUM >= PG_VERSION_15 */

View File

@ -62,4 +62,6 @@ DeparseGrantOnParameterStmt(Node *node)
return str.data;
}
#endif /* PG_VERSION_NUM >= PG_VERSION_15 */

View File

@ -2165,6 +2165,7 @@ GenerateGrantStmtForRights(ObjectType objectType,
withGrantOption);
}
/*
* GenerateGrantStmtForRightsWithObjectName is the function for creating
* GrantStmt's for all types of objects that are supported with object name.
@ -2183,6 +2184,7 @@ GenerateGrantStmtForRightsWithObjectName(ObjectType objectType,
permission, withGrantOption);
}
/*
* BaseGenerateGrantStmtForRights is the base function for creating
* GrantStmt's for all types of objects that are supported with object .

View File

@ -448,6 +448,7 @@ extern List * PreprocessDropOwnedStmt(Node *node, const char *queryString,
extern List * PostprocessReassignOwnedStmt(Node *node, const char *queryString);
#if PG_VERSION_NUM >= PG_VERSION_15
/* parameter.c - forward declarations */
extern List * PostprocessGrantParameterStmt(Node *node, const char *queryString);
#endif /* PG_VERSION_NUM >= PG_VERSION_15 */

View File

@ -255,6 +255,7 @@ extern char * DeparseDropDatabaseStmt(Node *node);
extern char * DeparseAlterDatabaseRenameStmt(Node *node);
#if PG_VERSION_NUM >= PG_VERSION_15
/* forward declarations for deparse_parameter_stmts.c*/
extern char * DeparseGrantOnParameterStmt(Node *node);
#endif /* PG_VERSION_NUM >= PG_VERSION_15 */