Renaming objects with code
To rename an object that contains code, for example, a stored routine, you need
to be twice as careful as you were in the first two situations. If you rename your
stored routine and make a mistake in the code, the procedure or function will be
lost and you will have to recreate it from memory.
dbForge Studio for MySQL refactoring tool uses an algorithm, that is different from
the one available in all MySQL administration tools:
A temporary stored routine is created. It contains the code of the procedure before
- All objects that use this routine are deleted.
- All objects that use this stored routine are recreated, but the routine is renamed.
- The routine with new name and new code is created.
- The temporary stored routine is deleted.
In case the fifth step fails, the script execution stops and the original code can
be restored from the temporary object.