Bug #17480
closedTABLE sys_refindex definition not compatible with mysql < 4.1.2
0%
Description
The following table definition fails when creating Typo3 tables on old mysql versions which don't support more than 255 characters in key indexes :
CREATE TABLE sys_refindex (
hash varchar(64) NOT NULL default '',
tablename varchar(80) NOT NULL default '',
recuid int(11) NOT NULL default '0',
field varchar(80) NOT NULL default '',
flexpointer text NOT NULL,
softref_key varchar(60) NOT NULL default '',
softref_id varchar(80) NOT NULL default '',
sorting int(11) NOT NULL default '0',
deleted tinyint(1) NOT NULL default '0',
ref_table varchar(80) NOT NULL default '',
ref_uid int(11) NOT NULL default '0',
ref_string text NOT NULL,
PRIMARY KEY (hash),
KEY lookup_rec (tablename,recuid),
KEY lookup_uid (ref_table,ref_uid),
KEY lookup_string (ref_table,ref_string(400))
);
The last line should be replaced by :
KEY lookup_string (ref_table,ref_string(255))
and the table definition gets accepted by mysql, at least on my server (version 3.23.58)
BLOB and TEXT columns can be indexed, but only by using an index prefix
length. That is, only a leading part of uniform length of a BLOB or
TEXT can be used for the index. In MySQL 4.1.2, the prefix can be up to
1000 characters; in earlier versions, the limit is 255 characters.
Read this page for more information:
http://dev.mysql.com/doc/mysql/en/indexes.html
(issue imported from #M5987)