Bug #50492 EER Diagram - Place Relationship generates bogus name for foreign keys
Submitted: 21 Jan 2010 2:18 Modified: 29 Jan 2010 16:06
Reporter: James Couhlin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.2.14 OS:Windows
Assigned to: Alfredo Kojima CPU Architecture:Any
Tags: Beta Relationship

[21 Jan 2010 2:18] James Couhlin
Description:
When using option(6), Place relationship using existing columns:
  . The error is that the foreign key names are:
     fk_%dcolumn%1
     fk_%dcolumn%2

Substitution is not occuring.

How to repeat:
Given two tables:
  . Individuals
     IndividualId INT UNSIGNED NOT NULL PRIMARY KEY

  . RelatedIndividuals
     ParentId INT UNSIGNED NOT NULL
    ,ChildId  INT UNSIGNED NOT NULL
    ,PRIMARY KEY(ParentId, ChildId)

Using Option(6) Place a relationship using existing columns:
    . Click RelatedIndividuals.ParentId, then click Individuals.IndividualsId
    . Click RelatedIndividuals.ChildId, then click Individuals.IndividualsId

Edit Table RelatedIndividuals and the errors show up under the tab Foreign Keys
  . The error is that the foreign key names are:
     fk_%dcolumn%1
     fk_%dcolumn%2

For all other "create relationship" gui actions, the destination column is substitued. However for this one option(6), no substituion is occuring!
[21 Jan 2010 11:15] Johannes Taxacher
i could not repeat that. could you maybe provide the model you are seeing that err. does that also occur on a model created from scratch (thats how i tried to reproduce).
[21 Jan 2010 17:11] James Couhlin
BugExample.mwb

Attachment: BugExample.mwb (application/octet-stream, text), 5.78 KiB.

[21 Jan 2010 17:12] James Couhlin
Example workbench file now shows erroneous foreign key names that have been generated.
[22 Jan 2010 10:33] Susanne Ebrecht
I am not able to follow you here.

What do you think is the bug?
[22 Jan 2010 15:40] Alfredo Kojima
This has been fixed. Creating a relationship from ParentId to InvididualId will create a fk called fk_IndividualId if the fk name template is fk_%dcolumn%
[29 Jan 2010 16:06] Tony Bedford
An entry has been added to the 5.2.15 changelog:

On an EER Diagram, when a relationship was placed using the toolbar button Place a Relationship using Existing Columns, if the relationship was subsequently checked in the Foreign Keys tab of the Table Editor, it was found to contain incorrect values for foreign key names, for example, fk_%dcolumn%1. It was apparent that the placeholder had not had its value correctly substituted.