Details
-
Task
-
Status: Open (View Workflow)
-
Trivial
-
Resolution: Unresolved
-
None
-
None
Description
It is possible to give the GRANT OPTION privilege to a user on a specific database or table along with other privileges on a single statement but not to REVOKE them the same way.
For example, it is possible to GRANT those in a single statement :
GRANT SELECT, INSERT ON `testuser`.table TO 'testuser'@'%' WITH GRANT OPTION; |
But two statements are required to REVOKE :
REVOKE ALL PRIVILEGES ON `testuser`.table FROM 'testuser'@'%'; |
REVOKE GRANT OPTION ON `testuser`.table FROM 'testuser'@'%'; |
The single statement REVOKE is only possible for GRANT OPTION that are server-wide but not limited to a database or a table, such as :
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser'@'%'; |
—
A similar syntax for database/tables would be more consistent, for example :
REVOKE ALL PRIVILEGES, GRANT OPTION ON `testuser`.table FROM 'testuser'@'%'; |
While it's not consistent with the GRANT which requires the WITH GRANT OPTION at the end of the statement, it would still be more consistent than having to use two different statements.