Bug #72113 | Manual does not explain "silent length reduction" for index prefix | ||
---|---|---|---|
Submitted: | 24 Mar 2014 17:26 | Modified: | 18 Jun 2014 17:17 |
Reporter: | Valeriy Kravchuk | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | 5.5, 5.6 | OS: | Any |
Assigned to: | Daniel Price | CPU Architecture: | Any |
Tags: | innodb_large_prefix |
[24 Mar 2014 17:26]
Valeriy Kravchuk
[24 Mar 2014 21:58]
MySQL Verification Team
Thank you for the bug report.
[18 Jun 2014 17:17]
Daniel Price
Index prefix "silent length reduction" is still present in MySQL 5.5 as shown in the example below. This "permissive" behaviour is no longer present in 5.6+ and an error is returned. The reference manual has been updated. The changes should appear soon, with the next published documentation build. http://dev.mysql.com/doc/refman/5.6/en/innodb-restrictions.html http://dev.mysql.com/doc/refman/5.7/en/innodb-restrictions.html Thank you for the bug report. MySQL 5.5: mysql> create table test1(a varchar(500)) engine=InnoDB row_format=dynamic DEFAULT CHARSET=utf8; Query OK, 0 rows affected (0.03 sec) mysql> CREATE INDEX i1 ON test1 (a(256)); Query OK, 0 rows affected, 2 warnings (0.03 sec) Records: 0 Duplicates: 0 Warnings: 2 mysql> show warnings; +---------+------+---------------------------------------------------------+ | Level | Code | Message | +---------+------+---------------------------------------------------------+ | Warning | 1071 | Specified key was too long; max key length is 767 bytes | | Warning | 1071 | Specified key was too long; max key length is 767 bytes | +---------+------+---------------------------------------------------------+ 2 rows in set (0.00 sec) mysql> show create table test1\G *************************** 1. row *************************** Table: test1 Create Table: CREATE TABLE `test1` ( `a` varchar(500) DEFAULT NULL, KEY `i1` (`a`(255)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC 1 row in set (0.00 sec)