Bug #69628 incorect error for GRANT PROCEDURE
Submitted: 1 Jul 2013 11:16 Modified: 26 Aug 2013 17:49
Reporter: martin fuxa Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:5.6.12 OS:Any
Assigned to: CPU Architecture:Any

[1 Jul 2013 11:16] martin fuxa
Description:
GRANT for non-existed PROCEDURE returns error "FUNCTION or PROCEDURE ..." even if FUNCTION with given name really exists, which is little bit misleading.

GRANT EXECUTE ON PROCEDURE test.foo to 'root'@'%';
ERROR 1305 (42000): FUNCTION or PROCEDURE foo does not exist

How to repeat:
use test;
delimiter :
create function foo() returns int begin return 1; end:
delimiter ;

GRANT EXECUTE ON PROCEDURE test.foo to 'root'@'%';
-- error with misleading message
GRANT EXECUTE ON FUNCTION test.foo to 'root'@'%';
-- Query OK, 0 rows affected (0.00 sec)

drop function foo;

Suggested fix:
error message dependency
[1 Jul 2013 12:36] MySQL Verification Team
Hello martin,

Thank you for the bug report. 
Verified as described.

Thanks,
Umesh
[26 Aug 2013 17:49] Paul DuBois
Noted in 5.7.3 changelog.

For GRANT statements, ER_SP_DOES_NOT_EXIST errors for nonexistent
stored procedures and functions now specify "PROCEDURE does not exist"
or "FUNCTION does not exist" rather than the less-specific "PROCEDURE or
FUNCTION does not exist".