[#6931] Added parser support for GRANT OPTION FOR clause
This commit is contained in:
parent
12a9c0e696
commit
c19ab98047
@ -151,7 +151,16 @@ truncateStatement = 'TRUNCATE TABLE' tableName [ 'CONTINUE IDENTITY' | 'RESTART
|
||||
grantStatement = 'GRANT' ( 'SELECT' | 'INSERT' | 'UPDATE' | 'DELETE' ) 'ON' tableName 'TO' ( userName | roleName | 'PUBLIC')
|
||||
;
|
||||
|
||||
revokeStatement = 'REVOKE' ( 'SELECT' | 'INSERT' | 'UPDATE' | 'DELETE' ) 'ON' tableName 'FROM' ( userName | roleName | 'PUBLIC')
|
||||
revokeStatement = 'REVOKE'
|
||||
[ 'GRANT OPTION FOR' ]
|
||||
(
|
||||
'SELECT'
|
||||
| 'INSERT'
|
||||
| 'UPDATE'
|
||||
| 'DELETE'
|
||||
)
|
||||
'ON' tableName
|
||||
'FROM' ( userName | roleName | 'PUBLIC')
|
||||
;
|
||||
|
||||
selectStatement = select | values [ correlationName ]
|
||||
|
||||
@ -1318,6 +1318,7 @@ class ParserImpl implements Parser {
|
||||
|
||||
private static final DDLQuery parseRevoke(ParserContext ctx) {
|
||||
parseKeyword(ctx, "REVOKE");
|
||||
boolean grantOptionFor = parseKeywordIf(ctx, "GRANT OPTION FOR");
|
||||
Privilege privilege = parsePrivilege(ctx);
|
||||
List<Privilege> privileges = null;
|
||||
|
||||
@ -1334,7 +1335,12 @@ class ParserImpl implements Parser {
|
||||
parseKeywordIf(ctx, "TABLE");
|
||||
Table<?> table = parseTableName(ctx);
|
||||
|
||||
RevokeOnStep s1 = privileges == null ? ctx.dsl.revoke(privilege) : ctx.dsl.revoke(privileges);
|
||||
RevokeOnStep s1 = null;
|
||||
if (grantOptionFor)
|
||||
s1 = privileges == null ? ctx.dsl.revokeGrantOptionFor(privilege) : ctx.dsl.revokeGrantOptionFor(privileges);
|
||||
else
|
||||
s1 = privileges == null ? ctx.dsl.revoke(privilege) : ctx.dsl.revoke(privileges);
|
||||
|
||||
parseKeyword(ctx, "FROM");
|
||||
User user = parseKeywordIf(ctx, "PUBLIC") ? null : parseUser(ctx);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user