I'm using MySQL 5.5.31 on fedora and I have trouble dropping a non existing procedure. With the root user:
- Create a new database: test
- Create a new user: test
Give all permissions to user test for database test
GRANT ALL PRIVILEGES ON test.* TO 'test'@'%' WITH GRANT OPTION;
With user test
CREATE PROCEDURE test.foo() SELECT NOW(); DROP PROCEDURE IF EXISTS test.foo; Query OK, 0 rows affected (0.00 sec) DROP PROCEDURE IF EXISTS test.foo; ERROR 1370 (42000): alter routine command denied to user 'test'@'localhost' for routine 'test.foo'
Why is the "IF EXISTS" not working?
If I do the same with the root user everything works fine (with warning, but that is okay):
With user test
CREATE PROCEDURE test.foo() SELECT NOW(); DROP PROCEDURE IF EXISTS test.foo; Query OK, 0 rows affected (0.00 sec) DROP PROCEDURE IF EXISTS test.foo; Query OK, 0 rows affected, 1 warning (0.00 sec)