Bug #23543 add feature "drop index if exists"
Submitted: 23 Oct 2006 9:54 Modified: 6 Oct 2008 12:33
Reporter: Justin Vassallo
Status: Duplicate
Category:Server: General Severity:S4 (Feature request)
Version:5.0.22 OS:Sun Solaris (Solaris 9)
Assigned to: Target Version:
Tags: Drop, INDEX, exists
Triage: D5 (Feature request)

[23 Oct 2006 9: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 21: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 12:33] Valeriy Kravchuk
Duplicate of bug #15287, I think. Yet another case of inconsitency.