Bug #6182 Triggers: duplicate names allowed
Submitted: 20 Oct 2004 17:47 Modified: 20 Jul 2005 15:42
Reporter: Trudy Pelzer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.2-debug OS:Linux (SuSE 9.1)
Assigned to: Antony Curtis CPU Architecture:Any

[20 Oct 2004 17:47] Trudy Pelzer
Description:
According to WL#1218: 
-- The trigger name must be a valid identifier (same rules  
as for  other object names), and must be unique within the  
schema/database.  But I am able to create two triggers 
that have the same name; this should be disallowed. 

How to repeat:
mysql> create table t2 (col1 int, col2 int) engine=memory; 
Query OK, 0 rows affected (0.01 sec) 
 
mysql> create table t3 (col1 int, col2 int) engine=memory; 
Query OK, 0 rows affected (0.01 sec) 
 
mysql> create trigger t2_bi_1 before insert on t2 for each row begin end; 
Query OK, 0 rows affected (0.00 sec) 
 
mysql> create trigger t2_bi_1 before insert on t3 for each row begin end; 
Query OK, 0 rows affected (0.00 sec) 
-- Note that the trigger name is the same as the name 
of the first trigger created. This statement should be 
rejected with SQLSTATE HY000 trigger already exists
[3 Jul 2005 18:43] Antony Curtis
See Bug#5892
[19 Jul 2005 20:27] Dmitry Lenev
Fixed in 5.0.10
[20 Jul 2005 15:42] Mike Hillyer
Documented in 5.0.10 changelog.