MySQL Forums
Forum List  »  Newbie

Index Exceeding Max Length??????
Posted by: Margaret Waldman
Date: June 06, 2007 10:32PM

Does anyone know why the following code generates the following error?

CREATE TABLE test1
(
test text(256) NOT NULL,
PRIMARY KEY (test(256))
);

CREATE TABLE test2
(
id int NOT NULL,
test1 text(256) NOT NULL,
test2 text(256) NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (test1(256)) REFERENCES test1 (test)
);

CREATE UNIQUE INDEX test4_index ON test5
(
test1(256),test2(256)
);

#1071 - Specified key was too long; max key length is 1000 bytes

I thought 256+256=512

Options: ReplyQuote


Subject
Written By
Posted
Index Exceeding Max Length??????
June 06, 2007 10:32PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.