Bug #93673 unique key column in information_schema.COLUMNS is PRI not UNI
Submitted: 19 Dec 2018 8:59 Modified: 19 Jan 11:53
Reporter: 李威 李 Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[19 Dec 2018 8:59] 李威 李
Description:
CREATE TABLE `t285` (
  `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  UNIQUE KEY `a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
in
https://dev.mysql.com/doc/refman/5.6/en/columns-table.html
says :
in table information_schema.COLUMNS 
[If COLUMN_KEY is PRI, the column is a PRIMARY KEY or is one of the columns in a multiple-column PRIMARY KEY.]
If COLUMN_KEY is UNI, the column is the first column of a UNIQUE index. (A UNIQUE index permits multiple NULL values, but you can tell whether the column permits NULL by checking the Null column.)]
actually it is PRI ,not UNI

How to repeat:
mysql> show create table t285;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                               |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t285  | CREATE TABLE `t285` (
  `a` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  UNIQUE KEY `a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql>  select * from information_schema.COLUMNS where TABLE_NAME='t285';     
+---------------+--------------+------------+-------------+------------------+----------------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+----------------+--------------+------------+--------------------------------+---------------------------------+----------------+-----------------------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | ORDINAL_POSITION | COLUMN_DEFAULT       | IS_NULLABLE | DATA_TYPE | CHARACTER_MAXIMUM_LENGTH | CHARACTER_OCTET_LENGTH | NUMERIC_PRECISION | NUMERIC_SCALE | DATETIME_PRECISION | CHARACTER_SET_NAME | COLLATION_NAME | COLUMN_TYPE  | COLUMN_KEY | EXTRA                          | PRIVILEGES                      | COLUMN_COMMENT | GENERATION_EXPRESSION |
+---------------+--------------+------------+-------------+------------------+----------------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+----------------+--------------+------------+--------------------------------+---------------------------------+----------------+-----------------------+
| def           | test         | t285       | a           |                1 | CURRENT_TIMESTAMP(6) | NO          | timestamp |                     NULL |                   NULL |              NULL |          NULL |                  6 | NULL               | NULL           | timestamp(6) | PRI        | on update CURRENT_TIMESTAMP(6) | select,insert,update,references |                |                       |
+---------------+--------------+------------+-------------+------------------+----------------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+----------------+--------------+------------+--------------------------------+---------------------------------+----------------+-----------------------+
1 row in set (0.14 sec)
[19 Dec 2018 11:53] Miguel Solorzano
Thank you for the bug report. Please filed the exactly server version are you using field. Thanks.
[20 Jan 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".