We're updating the issue view to help you get more done. 

MySQL ddl script fails

Steps to reproduce

Steps to reproduce:
1. Create a new MySQL database on Centos 5.5 using the latest mysql5.sql

Actual Results:

mysql> source ../mysql5.sql
Query OK, 12 rows affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

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

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes
Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Expected Results:

Tables which have a PRIMARY KEY of multiple columns where UTF8 is used and the column is VARCHAR(255) generated this error. UTF-8 is computed at 3 or 4 bytes per character causing the 1000 character limit to be exceeded.

Workaround (if any):

You can reduce to VARCHAR(128) which will get rid of the error, but this maybe is not the correct solution. Example:

CREATE TABLE capture_agent_state (
organization VARCHAR(128) NOT NULL,
id VARCHAR(128) NOT NULL,
configuration TEXT(65535),
state TEXT(65535) NOT NULL,
last_heard_from BIGINT NOT NULL,
url TEXT(65535),
PRIMARY KEY (
organization,
id)
);

Not sure what the correct fix is. Using Latin1 will reduce character size encoding, but I don't think that is the right move.

Status

Assignee

Greg Logan

Reporter

Hank Magnuski

Severity

Incorrectly Functioning With Workaround

Tags (folksonomy)

Components

Fix versions

Affects versions

1.3

Priority

Blocker