Bug #10246 Parser: bad syntax for GRANT EXECUTE
Submitted: 28 Apr 2005 21:21 Modified: 31 May 2005 1:59
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.6-beta-debug OS:Linux (SUSE 9.2)
Assigned to: Antony Curtis CPU Architecture:Any

[28 Apr 2005 21:21] Peter Gulutzan
Description:
MySQL currently allows:
GRANT EXECUTE ON routine_name ...
This is ambiguous, because there are two kinds of routines
stored procedures and functions), and someday MySQL
might have execute privileges for other objects too (e.g.
packages).
Therefore MySQL must require:
GRANT EXECUTE ON { PROCEDURE | FUNCTION } routine_name ...
and
REVOKE EXECUTE ON {PROCEDURE | FUNCTION } routine_name ...
This would be closer to the ANSI/ISO standard too.

No change is necessary for GRANT EXECUTE ON database_name.* ...
No support is necessary for GRANT EXECUTE ON ROUTINE ...

How to repeat:
mysql> create procedure p79 () set @a=5;
Query OK, 0 rows affected (0.03 sec)

mysql> create function p79 () returns int return 5;
Query OK, 0 rows affected (0.00 sec)

mysql> grant execute on p79 to m;
Query OK, 0 rows affected (0.03 sec)

mysql> grant execute on function p79 to m;
ERROR 1064 (42000): You have an error in your SQL syntax ...

Suggested fix:
[15 May 2005 23:14] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24920
[15 May 2005 23:14] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24921
[15 May 2005 23:14] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24922
[15 May 2005 23:15] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24923
[17 May 2005 18:55] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24986
[17 May 2005 20:31] Antony Curtis
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html
[31 May 2005 1:59] Paul DuBois
Noted in 5.0.6 changelog, GRANT section,
and grant table structure section.