Bug #35523 Foreign keys: constraint name overrides foreign key name
Submitted: 24 Mar 2008 17:35 Modified: 25 Jun 2008 20:12
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:6.1-fk-debug OS:Linux (SUSE 10 | 32-bit)
Assigned to: Dmitry Lenev CPU Architecture:Any

[24 Mar 2008 17:35] Peter Gulutzan
Description:
I'm using mysql-6.1-fk.
I start mysqld with --foreign-key-all-engines=1.

I create a table with a CONSTRAINT x FOREIGN KEY y clause.
There is no error message. But the 'FOREIGN KEY y"
(which contradicts "CONSTRAINT x") is ignored.

How to repeat:
create table t1 (s1 int primary key);
create table t2 (s1 int, constraint X foreign key Y (s1) references t1(s1));
show create table t2;
[24 Mar 2008 22:26] MySQL Verification Team
Thank you for the bug report. Verified as described.
[19 Jun 2008 14:38] Trudy Pelzer
For errors when creating tables with
contradictory foreign-key clauses,
we want an error even if
@@foreign_key_checks = 0.
[25 Jun 2008 9:42] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/48454

2675 Dmitry Lenev	2008-06-25
      Fix for bug #35523 "Foreign keys: constraint name overrides foreign
      key name".
      
      In --foreign-key-all-engines mode we should emit an error in
      cases when user specifies two different names for foreign key
      via standard CONSTRAINT and non-standard FOREIGN KEY clauses.
      We should emit a warning if user uses non-standard FOREIGN KEY
      clause to specify name for foreign key.
[25 Jun 2008 19:50] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/48526

2676 Dmitry Lenev	2008-06-25
      Fix for bug #35523 "Foreign keys: constraint name overrides foreign
      key name".
      
      In --foreign-key-all-engines mode we should emit an error in
      cases when user specifies two different names for foreign key
      via standard CONSTRAINT and non-standard FOREIGN KEY clauses.
      We should emit a warning if user uses non-standard FOREIGN KEY
      clause to specify name for foreign key.
[25 Jun 2008 20:12] Dmitry Lenev
Fix for this bug was pushed into mysql-6.1-fk tree. Since this bug was reported
against tree which is not publicly available yet I am simply closing this bug.