Bug #47773 RENAME TABLE should have IF EXISTS option
Submitted: 1 Oct 2009 20:15 Modified: 13 Oct 2009 10:27
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S4 (Feature request)
Version:any OS:Any
Assigned to: CPU Architecture:Any
Tags: qc

[1 Oct 2009 20:15] Peter Laursen
Description:
RENAME TABLE should have IF EXISTS option

How to repeat:
RENAME TABLE IF EXISTS a TO b;
-- syntax error 1064

Suggested fix:
Add the option!

Option would make it easier to avoid abortion of a script due to non-existing table. Now you will have to check for the condition client-side and branch script/application to handle every situation (or start creating a stupid table with CREATE TABLE IF NOT EXISTS what is a very ugly workaround).
[1 Oct 2009 22:33] MySQL Verification Team
Thank you for the bug report.
[2 Oct 2009 14:47] Konstantin Osipov
Workaround: use a stored procedure and a continue handler.
[6 Jan 2010 14:09] MySQL Verification Team
See also bug #4754