Bug #87643 Description of prefix values for UNIQUE indexes is missing from create table doc
Submitted: 1 Sep 2017 22:12 Modified: 7 Oct 2017 13:37
Reporter: monty solomon Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.6, 5.7 OS:Any
Assigned to: CPU Architecture:Any

[1 Sep 2017 22:12] monty solomon
Description:
The documentation for UNIQUE indexes is inconsistent between CREATE TABLE and CREATE INDEX.

The CREATE TABLE section on UNIQUE indexes does not discuss prefixes and mentions something about _rowid.

The CREATE INDEX section on UNIQUE indexes discusses prefixes but does not mention anything about _rowid.

How to repeat:
Excerpt from CREATE TABLE Syntax
https://dev.mysql.com/doc/refman/5.7/en/create-table.html

UNIQUE

A UNIQUE index creates a constraint such that all values in the index must be distinct. An error occurs if you try to add a new row with a key value that matches an existing row. For all engines, a UNIQUE index permits multiple NULL values for columns that can contain NULL.

If a UNIQUE index consists of only one column that has an integer type, you can also refer to the column as _rowid in SELECT statements.

Excerpt from CREATE INDEX Syntax
https://dev.mysql.com/doc/refman/5.7/en/create-index.html

A UNIQUE index creates a constraint such that all values in the index must be distinct. An error occurs if you try to add a new row with a key value that matches an existing row. For all engines, a UNIQUE index permits multiple NULL values for columns that can contain NULL. If you specify a prefix value for a column in a UNIQUE index, the column values must be unique within the prefix.

Suggested fix:
Use the same text to describe unique indexes on both pages.

Add the _rowid reference to the CREATE INDEX page.

Does the existing _rowid reference on the CREATE TABLE page address the documentation requested in bug #42539?
[4 Sep 2017 6:44] MySQL Verification Team
Hello Monty,

Thank you for the report and feedback!

Thanks,
Umesh
[7 Oct 2017 13:37] Paul DuBois
Posted by developer:
 
Made UNIQUE descriptions consistent.