Bug #12473 DROP TRIGGER should support "IF EXISTS" Syntax
Submitted: 9 Aug 2005 21:12 Modified: 15 Aug 2005 16:45
Reporter: Jonathan Miller Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:5.0 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[9 Aug 2005 21:12] Jonathan Miller
Description:
 query 'DROP TRIGGER IF EXISTS test.t2_ai' failed: 1064: 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 EXISTS test.t2_ai' at line 1

DROP TRIGGER [schema_name.]trigger_name

Drops a trigger. The schema name is optional. If the schema is omitted, the trigger is dropped from the current schema.

Prior to MySQL 5.0.10, the table name was required instead of the schema name (table_name.trigger_name).

Note: When upgrading from a previous version of MySQL 5 to MySQL 5.0.10 or newer, you must drop all triggers before upgrading and re-create them after or DROP TRIGGER will not work after the upgrade.

The DROP TRIGGER statement requires the SUPER privilege. It was added in MySQL 5.0.2. 

How to repeat:
DROP TRIGGER IF EXISTS t_name;

Suggested fix:
support the IF EXISTS
[11 Aug 2005 18:10] Aleksey Kishkin
Well. It works as it's describen in the dicumentation. so I don't think it's a bug but rather feature request.
[15 Aug 2005 16:45] MySQL Verification Team
Duplicate of http://bugs.mysql.com/bug.php?id=12337.

Thank you for the bug report.