(Edit2: Did some more testing. It seems the issue in my first edit goes away when you reconnect to the database. The stored procedures must be in memory or something of that nature)
(Edit: I just tried using the following and it didn't work entirely as expected. The name changed and i could call the procedure using the new name, however, I could also still call it using the old name -- weird)
I had a look around to and couldn't see way to do it using ALTER PROCEDURE. The NAME characteristic isn't documented
here.
To rename without doing a DROP then CREATE the following should work. I'd be interested to know if there is a better way of doing this.
UPDATE `mysql`.`proc`
SET name = '<new_proc_name>',
specific_name = '<new_proc_name>'
WHERE db = '<database>' AND
name = '<old_proc_name>';
Also note: If have granted privileges to users for this procedure you will need to update the procedure name in procs_priv as well.
UPDATE `mysql`.`procs_priv`
SET Routine_name = '<new_proc_name>'
WHERE Db = '<database>' AND
Routine_name = '<old_proc_name>';
FLUSH PRIVILEGES;
Edited 3 time(s). Last edit at 08/04/2009 07:21AM by Byron Platt.