Bug #5927 Wrong SQL Code on 'CREATE TABLE'
Submitted: 6 Oct 2004 15:36 Modified: 6 Oct 2004 19:05
Reporter: Gernot Brandl Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.0.12 OS:Windows (Windows 2000)
Assigned to: Michael G. Zinner CPU Architecture:Any

[6 Oct 2004 15:36] Gernot Brandl
Description:
If i create a table with a two-column primary key, Mysql Administrator creates wrond SQL Code:

Example:
CREATE TABLE `test`.`mklp_topic` (
  `mkl_id` MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY,
  `ukl_seq_id` MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY,
  `cr_uid` MEDIUMINT UNSIGNED NOT NULL
);

See Screenshot's attached

How to repeat:
2 Ways:
- Create a table and click the index-symbol for two columns to the (primary-)key symbol and then click 'Apply Changes'

- Create a table and create a two-column primary key using the 'indices'-Tab and then click 'Apply Changes'.

Suggested fix:
Just change it to:
CREATE TABLE `test`.`mklp_topic` (
  `mkl_id` MEDIUMINT UNSIGNED NOT NULL,
  `ukl_seq_id` MEDIUMINT UNSIGNED NOT NULL,
  `cr_uid` MEDIUMINT UNSIGNED NOT NULL,
  PRIMARY KEY(mkl_id, ukl_seq_id)
);
[6 Oct 2004 15:37] Gernot Brandl
Screenshot Example 1

Attachment: mysql_admin_err_0.gif (image/gif, text), 19.47 KiB.

[6 Oct 2004 15:38] Gernot Brandl
Example 2

Attachment: mysql_admin_err_1.gif (image/gif, text), 19.59 KiB.

[6 Oct 2004 16:04] MySQL Verification Team
Verified with build 1.0.13.3.
[6 Oct 2004 19:05] Michael G. Zinner
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