Page MenuHomePhabricator

Installation fails with mySQL error 1071 while creating table categorylinks
Closed, ResolvedPublic

Description

Author: carltonb

Description:
Output from configuration script index.php:

Creating tables...Query "CREATE TABLE categorylinks ( cl_from int(8) unsigned NOT
NULL default '0', cl_to varchar(255) binary NOT NULL default '', cl_sortkey varchar
(255) binary NOT NULL default '', cl_timestamp timestamp NOT NULL, UNIQUE KEY
cl_from(cl_from,cl_to), KEY cl_sortkey(cl_to,cl_sortkey(128)), KEY cl_timestamp
(cl_to,cl_timestamp) )" failed with error code "Specified key was too long; max key
length is 1024 bytes".

More information: mySQL version 4.1.9. Reproduced error from mySQL command line.
mySQL error is 1071. For some reason mySQL is multiplying the specified column
length by a factor of 3. Thus, (128*3) + (255*3) = 1149 which is greater than the
allowed 1024. This can be seen by using the diagnostic command "show index from
categorylinks" which shows the tripled lengths of of columns that have been
included as substrings.

Workaround:
changed this clause:

KEY cl_sortkey(cl_to,cl_sortkey(128))

to this:

KEY cl_sortkey(cl_to,cl_sortkey(86))

Install script now creates all tables successfully.

Suggestions:
Decrease the width of either the cl_sortkey key fields, or of the columns themselves
Identify what in mySQL is causing substring lengths in indices to be tripled in
width.


Version: 1.3.x
Severity: normal
OS: Windows XP
Platform: PC

Details

Reference
bz1655

Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:14 PM
bzimport set Reference to bz1655.
bzimport added a subscriber: Unknown Object (MLST).
  • This bug has been marked as a duplicate of 1322 ***
epriestley added a commit: Unknown Object (Diffusion Commit).Mar 4 2015, 8:23 AM
epriestley added a commit: Unknown Object (Diffusion Commit).