DBZ-8209 Support for unkown roles and users in REVOKE

This commit is contained in:
Jiri Pechanec 2024-09-06 08:25:58 +02:00 committed by Anisha Mohanty
parent d5f0973654
commit d1c70d64c9
2 changed files with 9 additions and 6 deletions

View File

@ -1719,15 +1719,16 @@ renameUser
;
revokeStatement
: REVOKE privelegeClause (',' privelegeClause)*
: REVOKE ifExists? (privelegeClause | uid) (',' privelegeClause | uid)*
ON
privilegeObject=(TABLE | FUNCTION | PROCEDURE)?
privilegeLevel
FROM userName (',' userName)* #detailRevoke
| REVOKE ALL PRIVILEGES? ',' GRANT OPTION
FROM userName (',' userName)* #shortRevoke
| REVOKE (userName | uid) (',' (userName | uid))*
FROM (userName | uid) (',' (userName | uid))* #roleRevoke
FROM userName (',' userName)* (IGNORE UNKNOWN USER)? #detailRevoke
| REVOKE ifExists? ALL PRIVILEGES? ',' GRANT OPTION
FROM userName (',' userName)* (IGNORE UNKNOWN USER)? #shortRevoke
| REVOKE ifExists? (userName | uid) (',' (userName | uid))*
FROM (userName | uid) (',' (userName | uid))*
(IGNORE UNKNOWN USER)? #roleRevoke
;
revokeProxy

View File

@ -99,6 +99,8 @@ REVOKE reader FROM 'mysqluser'@'localhost'
REVOKE reader FROM topreader
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'retool'@
REVOKE `cloudsqlsuperuser`@`%` FROM `sarmonitoring`@`10.90.29.%`
REVOKE IF EXISTS SELECT ON test.t1 FROM jerry@localhost;
REVOKE IF EXISTS Bogus ON test FROM jerry@localhost IGNORE UNKNOWN USER;
-- MariaDB
GRANT BINLOG_MONITOR ON *.* TO 'mysqluser'@'localhost'