Bug #14381 Key length is limited to 255 bytes on BDB
Submitted: 27 Oct 2005 11:35 Modified: 1 Nov 2005 20:17
Reporter: Hakan Kuecuekyilmaz
Status: Closed
Category:Server: BDB Severity:S4 (Feature request)
Version:5.0.16-debug-log OS:Linux (Linux)
Assigned to: Andrey Hristov Target Version:
Triage: D5 (Feature request)

[27 Oct 2005 11:35] Hakan Kuecuekyilmaz
Description:
Key length is limited to 255 bytes on BerkeleyDB.

How to repeat:
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
  a varchar(127)
) Engine BerkeleyDB CHARACTER SET utf8;

ALTER TABLE t1 ADD PRIMARY KEY (a);

Output:

[11:30] root@test>Use test;
DDatabase changed
5.0.16-debug-log
[11:30] root@test>DROP TABLE IF EXISTS t1;
CRQuery OK, 0 rows affected, 1 warning (0.00 sec)

5.0.16-debug-log
[11:30] root@test>CREATE TABLE t1 (
    ->   a varchar(127)
    -> ) Engine BerkeleyDB CHARACTER SET utf8;

ALTER TABLE t1 ADD PRIMARY KEY (a);Query OK, 0 rows affected (0.10 sec)

5.0.16-debug-log
[11:30] root@test>
5.0.16-debug-log
[11:30] root@test>ALTER TABLE t1 ADD PRIMARY KEY (a);
ERROR 1071 (42000): Specified key was too long; max key length is 255 bytes

Suggested fix:
Support longer key.
[31 Oct 2005 14:15] 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/31683
[1 Nov 2005 20:17] Paul DuBois
Noted in 5.0.16 changelog.