Bug #32927 | Create/drop trigger: if (not) exists and recreate if exists | ||
---|---|---|---|
Submitted: | 3 Dec 2007 13:25 | Modified: | 14 Dec 2007 9:11 |
Reporter: | Olaf van der Spek (Basic Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Stored Routines | Severity: | S4 (Feature request) |
Version: | * | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | qc |
[3 Dec 2007 13:25]
Olaf van der Spek
[3 Dec 2007 14:05]
Valeriy Kravchuk
Thank you for a reasonable feature request.
[14 Dec 2007 9:11]
Olaf van der Spek
I just noticed "DROP TRIGGER [IF EXISTS]" is supported. I guess I only looked at create trigger and assumed drop trigger wouldn't support if exists either. As a drop trigger if exists ?; create trigger series works fine, I'm closing this request.
[4 Mar 2012 19:09]
MELERIX ...
DROP TRIGGER IF EXIST is still not working... for example: DROP TRIGGER IF EXIST `set_current_date`; CREATE TRIGGER `set_current_date` BEFORE INSERT ON `characters` FOR EACH ROW SET NEW.createDate = curdate(); it will throw: [Err] 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 'EXIST `set_current_date`' at line 1 [Err] DROP TRIGGER IF EXIST `set_current_date`;