Bug #13315 InnoDB index columns should have a maximum length of 767
Submitted: 19 Sep 2005 10:08 Modified: 17 Nov 2005 16:17
Reporter: Osku Salerma
Status: Closed
Category:Server: InnoDB Severity:S3 (Non-critical)
Version:5.0 OS:
Assigned to: Paul DuBois Target Version:

[19 Sep 2005 10:08] Osku Salerma
Description:
According to Heikki, 767 should be the maximum allowed index length in InnoDB tables.
Current 5.0 allows a maximum index length of 1024, however. Apparently InnoDB previously
relied on the fact that MySQL had a generic 512 index length limit, and when this was
raised to 1024, a check was not added to InnoDB to guard against index lengths 768-1024.

Doc team: the manual is also wrong when talking about this, see my comment in bug
#13253.

How to repeat:
This should not be accepted but it is:

create table t1 (col1 varchar(768) primary key)
 character set = latin1 engine = innodb;

Suggested fix:
Refuse index lenghts 768-1024 for InnoDB tables.
[19 Sep 2005 14:39] Heikki Tuuri
Osku, Miguel,

it is an index COLUMN whose maximum allowed length is 767 bytes.

An InnoDB multi-column index is allowed to be 3500 bytes in length in total.

Regards,

Heikki
[21 Sep 2005 19:06] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/30163
[23 Sep 2005 10:20] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/30252
[23 Sep 2005 11:58] Osku Salerma
Pushed to 5.0.14.

Doc team: remember to update the manual to say that index columns have a maximum length
of 767 in InnoDB.
[24 Sep 2005 5:42] Paul DuBois
Is the maximum length of 767 measured in bytes or characters.
For example, does the max of 767 apply if the column character
set is ucs2 or utf8?
[26 Sep 2005 10:17] Osku Salerma
The 767 is the byte limit.
[3 Oct 2005 13:53] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/30631
[24 Oct 2005 10:56] Heikki Tuuri
Paul,

please document this if not yet documented.

Regards,

Heikki
[17 Nov 2005 16:17] Paul DuBois
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).