Skip navigation links

MySQL Forums :: Newbie :: Index Exceeding Max Length??????


Advanced Search

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?????? Margaret Waldman 06/06/2007 10:32PM
Re: Index Exceeding Max Length?????? Thomas CORBIERE 06/14/2007 10:30AM
Re: Index Exceeding Max Length?????? Jeff Tanner 11/05/2007 07:43PM
Index Exceeding Max Length?????? Margaret Waldman 10/26/2007 05:49PM


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.