Bug #2637 column privilege(s) not showing up in SHOW GRANTS
Submitted: 3 Feb 2004 22:53 Modified: 4 Feb 2004 8:54
Reporter: Paul Vlaar Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.15 OS:Linux (SuSE Linux 9.0)
Assigned to: Dean Ellis CPU Architecture:Any

[3 Feb 2004 22:53] Paul Vlaar
Description:
myworld.Oceans.Name is an existing column. 

How to repeat:
mysql> GRANT SELECT (Name) ON myworld.Oceans TO bla@localhost; 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> show grants for bla@localhost; 
+--------------------------------------------------------+ 
| Grants for bla@localhost                               | 
+--------------------------------------------------------+ 
| GRANT USAGE ON *.* TO 'bla'@'localhost'                | 
| GRANT USAGE ON `myworld`.`Oceans` TO 'bla'@'localhost' | 
+--------------------------------------------------------+ 
2 rows in set (0.01 sec)
[3 Feb 2004 23:01] Paul Vlaar
It seems even that the privilege is not even stored.
[3 Feb 2004 23:06] Paul Vlaar
Please ignore the last comment, the privileges do work as expected, 
but don't show up wrt the column.
[3 Feb 2004 23:13] Paul Vlaar
Another interesting little quirk: 
 
mysql> show grants for africa@localhost; 
+-----------------------------------------------------------+ 
| Grants for africa@localhost                               | 
+-----------------------------------------------------------+ 
| GRANT USAGE ON *.* TO 'africa'@'localhost'                | 
| GRANT USAGE ON `myworld`.`Oceans` TO 'africa'@'localhost' | 
+-----------------------------------------------------------+ 
2 rows in set (0.00 sec) 
 
mysql>  grant SELECT ON myworld.Oceans to africa@localhost; 
Query OK, 0 rows affected (0.01 sec) 
 
mysql> show grants for africa@localhost; 
+---------------------------------------------------------------------------+ 
| Grants for africa@localhost                                               | 
+---------------------------------------------------------------------------+ 
| GRANT USAGE ON *.* TO 'africa'@'localhost'                                | 
| GRANT SELECT, SELECT (Name) ON `myworld`.`Oceans` TO 'africa'@'localhost' | 
+---------------------------------------------------------------------------+ 
2 rows in set (0.01 sec)
[4 Feb 2004 8:54] Dean Ellis
This issue was fixed in 4.0.16:

"SHOW GRANTS showed USAGE instead of the real column-level privileges when no table-level privileges were given."