Bug #11062 Limit of 767 chars in text key
Submitted: 3 Jun 2005 8:17 Modified: 3 Jun 2005 11:45
Reporter: Mick Francis (Candidate Quality Contributor) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:4.1.12a OS:NT4
Assigned to: CPU Architecture:Any

[3 Jun 2005 8:17] Mick Francis
Description:
Creating an index or Primary Key for a text column for more than 767 characters gives the error:

ERROR 1005 (HY000): Can't create table '.\sfnperf\#sql-dbc_9.frm' (errno: 139)

How to repeat:
create table T (
    c1 mediumtext   not null,
    c2 mediumtext   null,
    c3 varchar(128) not null
) ENGINE=INNODB;

-- The following line gives the error
CREATE INDEX IX_T ON T(c1(768));

-- The following line is OK
CREATE INDEX IX_T ON T(c1(767));
[3 Jun 2005 11:45] Heikki Tuuri
Hi!

767 or 768 comes from the fact that we want to support keys on 256 first UTF-8 characters. We do not have plans for raising this limit.

Regards,

Heikki
[3 Jun 2005 12:55] Mick Francis
Might I suggest a more informative error message?