Bug #35214 ALTER TABLE combined with IF EXISTS
Submitted: 11 Mar 2008 14:27 Modified: 15 Mar 2008 20:37
Reporter: Frank Mussmann Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S4 (Feature request)
Version:5.0.12 OS:Linux
Assigned to: CPU Architecture:Any
Tags: ALTER TABLE, Drop, IF EXISTS

[11 Mar 2008 14:27] Frank Mussmann
Description:
When dropping columns (or indexes), it should be possible to use the if exists clause.

How to repeat:
No way to repeat. :-)

Suggested fix:
create table t1 (Number int not null);
alter table t1 add column t2 int not null;
alter table t1 drop column t2;    <---- OK - this works so far.
The idea I have is this little thing here:
alter table t1 drop column t3 if exists; <- This should drop the column t3 if it exits. The same procedure like drop database if exists.

The same with :
alter table t1 add index idx1(t2);
alter table t1 drop index idx1; <-- OK - This works
alter table t1 drop index idx1 if exists; <-- This should only drop the index if it exists.
[15 Mar 2008 20:37] MySQL Verification Team
Thank you for the bug report.