Bug #27288 REVOKE GRANT OPTION syntax in manual is incorrect
Submitted: 20 Mar 2007 13:02 Modified: 20 Mar 2007 13:43
Reporter: Baron Schwartz (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.26 OS:
Assigned to: CPU Architecture:Any
Tags: grant option, qc, revoke

[20 Mar 2007 13:02] Baron Schwartz
Description:
The REVOKE GRANT OPTION syntax does not work as specified in the manual.  I have to qualify it with ON *.* to make it revoke the GRANT OPTION.

Related bugs are #878 and #2642, but I do not think they are the same thing.  Will "fixing" this behavior, if it is indeed a bug, cause backwards compatibility issues?

How to repeat:
As root,

mysql> show grants for baron;
+----------------------------------------------------------------------------------------------------------------+
| Grants for baron@%                                                                                             |
+----------------------------------------------------------------------------------------------------------------+
| GRANT SELECT, PROCESS, SUPER ON *.* TO 'baron'@'%' IDENTIFIED BY PASSWORD '5d2e19393cc5ef67' WITH GRANT OPTION | 
+----------------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

mysql> REVOKE GRANT OPTION FROM 'baron'@'%';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM 'baron'@'%'' at line 1
mysql> REVOKE GRANT OPTION ON *.* FROM 'baron'@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> show grants for baron;
+----------------------------------------------------------------------------------------------------------+
| Grants for baron@%                                                                                       |
+----------------------------------------------------------------------------------------------------------+
| GRANT SELECT, PROCESS, SUPER ON *.* TO 'baron'@'%' IDENTIFIED BY PASSWORD '5d2e19393cc5ef67'             | 
+----------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

mysql> select version();
+-----------+
| version() |
+-----------+
| 5.0.26    | 
+-----------+
1 row in set (0.00 sec)

Suggested fix:
I'm not sure whether this is a documentation mistake or an actual bug.
[20 Mar 2007 13:43] Valeriy Kravchuk
Thank you for a problem report. I do not think that this is a bug, because formally, according to the manual, http://dev.mysql.com/doc/refman/5.0/en/revoke.html, you can REVOKE GRANT OPTION without ON clause only along with ALL PRIVILEGES:

REVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user] ...

Please, check.