Bug #23543 add feature "drop index if exists"
Submitted: 23 Oct 2006 7:54 Modified: 6 Oct 2008 10:33
Reporter: Justin Vassallo Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: General Severity:S4 (Feature request)
Version:5.0.22 OS:Solaris (Solaris 9)
Assigned to: CPU Architecture:Any
Tags: Drop, exists, INDEX
Triage: D5 (Feature request)

[23 Oct 2006 7:54] Justin Vassallo
Description:
i have a script which daily drops a table, and then re-creates it. I also re-create the indexes, to avoid index errors due to the drop/create. 

it would be useful to have the feature DROP INDEX "IF EXISTS"

How to repeat:
type "drop index if exists" in command line
[17 Nov 2006 20:09] Stephen Gornick
This "if exists" omission existed on drop trigger and it is now being added as a patch for drop trigger:
  http://bugs.mysql.com/bug.php?id=18161
  http://bugs.mysql.com/bug.php?id=23703

Thus after that is in place, 
  drop database [if exists]
  drop table [if exists]
  drop view [if exists]
  drop procedure [if exists]
  drop function [if exists]
  drop trigger [if exists]

and index is the only drop command that still doesn't support "if exists".
[6 Oct 2008 10:33] Valeriy Kravchuk
Duplicate of bug #15287, I think. Yet another case of inconsitency.
[26 Jan 2010 22:23] Jim Fitzgerald
Is this a duplicate of bug 15287?  Bug 15287 does not mention adding the 'IF EXIST' functionality for an index.