Bug #86849 auto-increment in Glossary is wrong
Submitted: 28 Jun 2017 9:27 Modified: 25 Jul 2017 18:51
Reporter: Tsubasa Tanaka (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.6, 5.7, 5.6-ja, 8.0 OS:Any
Assigned to: CPU Architecture:Any

[28 Jun 2017 9:27] Tsubasa Tanaka
Description:
Glossary describes as following,

> auto-increment
>   A property of a table column (specified by the AUTO_INCREMENT keyword) that automatically adds an ascending sequence of values in the column. InnoDB supports auto-increment only for primary key columns.

But actually InnoDB supports auto-increment for secondary key column.

https://dev.mysql.com/doc/refman/5.6/en/glossary.html
https://dev.mysql.com/doc/refman/5.6/ja/glossary.html
https://dev.mysql.com/doc/refman/5.7/en/glossary.html
https://dev.mysql.com/doc/refman/8.0/en/glossary.html

How to repeat:
mysql57 12> CREATE TABLE t1 (num int NOT NULL auto_increment, KEY (num)) Engine = InnoDB;
Query OK, 0 rows affected (0.02 sec)

mysql57 12> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `num` int(11) NOT NULL AUTO_INCREMENT,
  KEY `num` (`num`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
1 row in set (0.00 sec)

mysql57 12> INSERT INTO t1 VALUES (NULL);
Query OK, 1 row affected (0.01 sec)

mysql57 12> SELECT * FROM t1;
+-----+
| num |
+-----+
|   1 |
+-----+
1 row in set (0.00 sec)

mysql57 12> INSERT INTO t1 VALUES (NULL);
Query OK, 1 row affected (0.01 sec)

mysql57 12> SELECT * FROM t1;
+-----+
| num |
+-----+
|   1 |
|   2 |
+-----+
2 rows in set (0.00 sec)

Suggested fix:
Fix glossary.
[28 Jun 2017 10:22] MySQL Verification Team
Hello Tanaka-San,

Thank you for the report and feedback!

Thanks,
Umesh
[25 Jul 2017 18:51] Daniel Price
Posted by developer:
 
The incorrect statement was removed from the glossary entry.

Thank you for the bug report.