| Bug #76450 | generated column with "KEY" makes PRIMARY KEY | ||
|---|---|---|---|
| Submitted: | 23 Mar 2015 10:43 | Modified: | 24 Mar 2015 7:33 |
| Reporter: | Tsubasa Tanaka (OCA) | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: DDL | Severity: | S3 (Non-critical) |
| Version: | 5.7.6 | OS: | Linux (CentOS 6.5) |
| Assigned to: | CPU Architecture: | Any | |
[23 Mar 2015 10:43]
Tsubasa Tanaka
[23 Mar 2015 13:37]
MySQL Verification Team
Hello Tanaka-San, Thank you for the report. Thanks, Umesh
[24 Mar 2015 7:29]
Øystein Grøvlen
Posted by developer: Generated columns follow the same syntax as ordinary columns. For ordinary columns, the manual already says: "The key attribute PRIMARY KEY can also be specified as just KEY when given in a column definition." (http://dev.mysql.com/doc/refman/5.7/en/create-table.html)
[24 Mar 2015 7:33]
Tsubasa Tanaka
I confirmed that you're correct.
mysql57> create table t1 (num int key);
Query OK, 0 rows affected (0.04 sec)
mysql57> show create table t1\G
*************************** 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`num` int(11) NOT NULL,
PRIMARY KEY (`num`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
I change this case's status to "Closed", and I'm sorry to taking your time.
Thanks,
