Commit 287f2d29 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

MDEV-9443: Add REVOKE <role> as a command to PREPARE

parent c4bef7ad
......@@ -38,6 +38,15 @@ Grants for test_user@%
GRANT developers TO 'test_user'@'%'
GRANT USAGE ON *.* TO 'test_user'@'%'
#
# Test revoking a role.
#
SET @revokeRole = 'REVOKE developers FROM test_user';
PREPARE stmtRevokeRole FROM @revokeRole;
EXECUTE stmtRevokeRole;
SHOW GRANTS FOR test_user;
Grants for test_user@%
GRANT USAGE ON *.* TO 'test_user'@'%'
#
# Now drop the role.
#
SET @dropRole = 'DROP ROLE developers';
......
......@@ -32,6 +32,15 @@ EXECUTE stmtGrantRole;
SELECT * FROM mysql.roles_mapping;
SHOW GRANTS FOR test_user;
--echo #
--echo # Test revoking a role.
--echo #
SET @revokeRole = 'REVOKE developers FROM test_user';
PREPARE stmtRevokeRole FROM @revokeRole;
EXECUTE stmtRevokeRole;
SHOW GRANTS FOR test_user;
--echo #
--echo # Now drop the role.
--echo #
......
......@@ -2465,6 +2465,7 @@ static bool check_prepared_statement(Prepared_statement *stmt)
case SQLCOM_GRANT:
case SQLCOM_GRANT_ROLE:
case SQLCOM_REVOKE:
case SQLCOM_REVOKE_ROLE:
case SQLCOM_KILL:
case SQLCOM_COMPOUND:
case SQLCOM_SHUTDOWN:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment