Bug #12525 Foreign key reference input
Submitted: 11 Aug 2005 13:30 Modified: 8 Sep 2005 15:25
Reporter: Pierre Moermans Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.13 OS:Windows (Windows 2000)
Assigned to: Vladimir Kolesnikov CPU Architecture:Any

[11 Aug 2005 13:30] Pierre Moermans
Description:
one table A with two fields as PK (name,application).
another table B which has a foreign key reference to the PK of table A
Table A has fields (user,role,application)

Goal is to set up the foreign key reference:
role --> name
application --> application

When Declaring the ref table, the two fields are added under 'reference column' and application is set correspondingly under 'column'.
The correspondance of 'name' is left empy which is normal, but it is impossible to add 'role'.

How to repeat:
Execute the script:

*******************

CREATE DATABASE taupe;

use taupe;

CREATE TABLE `application_role` (
  `name` varchar(20) NOT NULL default '',
  `application` varchar(20) NOT NULL default '',
  `description` varchar(45) NOT NULL default 'no description',
  `creation` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`name`,`application`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='roles of applications';

CREATE TABLE `user_application_role` (
  `username` char(20) NOT NULL default '',
  `role` char(20) NOT NULL default '',
  `application` char(20) NOT NULL default '',
  `creation` datetime NOT NULL default '0000-00-00 00:00:00',
  PRIMARY KEY  (`username`,`role`,`application`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='link MxN between user and application_role';

******************

right-click the user_application_role table
click 'edit table'
add a foreign key by pressing the '+' sign
in 'ref. table' drop-docn box, select application_role
in front of the 'name' entry in the table, try to enter 'role' it doesn't work

Suggested fix:
When doubl-clicking the cell where to enter 'role', the drop-docn box should contain all the columns of the table being edited.
[11 Aug 2005 20:29] Jorge del Conde
Thanks for your bug report.  I was able to reproduce it using WinXP & QB 1.1.13
[8 Sep 2005 15:25] Vladimir Kolesnikov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html