Bug #65540 No support for CREATE INDEX IF NOT EXISTS
Submitted: 6 Jun 2012 17:43 Modified: 6 Jun 2012 18:55
Reporter: Stefan Arentz Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S4 (Feature request)
Version:5.5 OS:Any
Assigned to: CPU Architecture:Any

[6 Jun 2012 17:43] Stefan Arentz
Description:
MySQL has support for CREATE TABLE IF NOT EXISTS but is lacking support for CREATE INDEX IF NOT EXISTS. These two go hand in hand and it would be very nice to have the latter form also supported.

How to repeat:
mysql> CREATE UNIQUE INDEX IF NOT EXISTS FOO ON USERS (USERNAME);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF NOT EXISTS FOO ON USERS (USERNAME)' at line 1
[6 Jun 2012 18:55] Sveta Smirnova
Thank you for the feature request.