Bug #12311 no CREATE TRIGGER IF NOT EXISTS or DROP TRIGGER IF EXISTS
Submitted: 2 Aug 2005 2:47 Modified: 19 Jan 2006 20:00
Reporter: Arjen Lentz Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.0.10 OS:Any (any)
Assigned to: CPU Architecture:Any

[2 Aug 2005 2:47] Arjen Lentz
Description:
The following syntax is missing from the server
  CREATE TRIGGER IF NOT EXISTS trgname ...
and
  DROP TRIGGER IF EXISTS trgname ...

Similar syntax is supported with tables and procedures/functions, so it makes sense to also have it for triggers. It makes SQL scripts cleaner as they then wouldn't produce errors.

How to repeat:
See SQL parser.

Suggested fix:
Add syntax as mentioned.
[16 Oct 2005 22:47] Jeremy Cole
Agreed, the lack of DROP TRIGGER IF NOT EXISTS is maddening as I'm working with triggers testing out 5.0.
[19 Jan 2006 20:00] Jim Winstead
Duplicate of Bug #15287. (Which is a later bug, but includes the full set of object create/drop commands that don't support IF [NOT] EXISTS.)