Bug #5503 Views: GRANT REFERENCES statement should be disallowed
Submitted: 10 Sep 2004 2:13 Modified: 9 Dec 2008 18:44
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Documentation Severity:S4 (Feature request)
Version:5.0.2-alpha OS:Linux (SuSE 8.2)
Assigned to: Paul DuBois CPU Architecture:Any

[10 Sep 2004 2:13] Peter Gulutzan
MySQL 5.0 allows GRANT REFERENCES to apply to a view. It shouldn't. The 
REFERENCES privilege is applicable for constraints (foreign keys), and only base tables 
can be involved in that context. 

How to repeat:
mysql> create view v as select 'a'; 
Query OK, 0 rows affected (0.00 sec) 
mysql> grant references on v to pierre; 
Query OK, 0 rows affected (0.00 sec)
[19 Aug 2005 10:15] MySQL Verification Team
verified with 5.0.12-beta-debug-log
[18 Jun 2008 10:52] Konstantin Osipov
GRANT statement is performed on a name in a namespace. In particular, we don't check whether the underlying table is a view or a base table at the moment the grant is executed.
This needs to be documented in the manual.
[9 Dec 2008 18:44] Paul DuBois
Per further discussion with PeterG, there is nothing to do here. Closing.