You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

My System: Ubuntu 12.04 32bit Mysql 5.5.24

Running the setup.sh script or alternativilly populating the jwdb database with the SQL script in data/jwdb-empty.sql, i have the following error:

ERROR 1071 (42000) at line 1584: Specified key was too long; max key length is 1000 bytes

Reading the line 1584 in the jwdb-empty.sql file can see a table declaration. It define three keys: oid, TOOL_AGENT_NAME and APP_NAME. As the charset is utf8 and TOOL_AGENT_NAME and APP_NAME are varchars of 250 and 90 chars respectivilly, then the combined key is [(250 + 90) * 3 bytes] (3 bytes each utf8 char) = 930 bytes. As you can read in the Mysql documentation[1], you should take the limit of 1000 bytes for prefix indexes (767 bytes in InndoDB engine) into account when specifying a prefix length for a column that uses a multi-byte character set.

A workaround is to change the charset to latin1:

$ sed -i 's/utf8/latin1/g' jwdb-sample.sql

One could refactor the jwdb-sample.sql file and divide by 3 all the varchars declarations.

  • What ideas do you have to resolve this issue?
  • Is this happening only to me?

[1] http://dev.mysql.com/doc/refman/5.0/en/column-indexes.html

  • No labels