Bug 25503, reported by Dmitriy. When switching it to binary, I figured
that since it would always be one byte per character now, there would be
room to make it the full 255 bytes. In fact, if cl_to is utf8, the
(cl_to, cl_type, cl_sortkey, cl_from) index will be 255*3 + 1 + 255 + 4
= 1025 bytes, longer than the max of 1000. Shortening cl_sortkey to 230
bytes fixes this (fix tested by Dmitriy).
I didn't add an updater because if you're already running the current
schema without problems, you don't need this change.
-- changes are also incorporated into patch-categorylinks-better-collation2.sql,
-- for the benefit of trunk users who applied the original.
ALTER TABLE /*$wgDBprefix*/categorylinks
- CHANGE COLUMN cl_sortkey cl_sortkey varbinary(255) NOT NULL default '',
+ CHANGE COLUMN cl_sortkey cl_sortkey varbinary(230) NOT NULL default '',
ADD COLUMN cl_sortkey_prefix varchar(255) binary NOT NULL default '',
ADD COLUMN cl_collation varbinary(32) NOT NULL default '',
ADD COLUMN cl_type ENUM('page', 'subcat', 'file') NOT NULL default 'page',
-- large table unnecessarily for people upgrading from 1.16, so this will be
-- skipped if unneeded.
ALTER TABLE /*$wgDBprefix*/categorylinks
- CHANGE COLUMN cl_sortkey cl_sortkey varbinary(255) NOT NULL default '',
+ CHANGE COLUMN cl_sortkey cl_sortkey varbinary(230) NOT NULL default '',
CHANGE COLUMN cl_collation cl_collation varbinary(32) NOT NULL default '';
INSERT IGNORE INTO /*$wgDBprefix*/updatelog (ul_key) VALUES ('cl_fields_update');
-- A binary string obtained by applying a sortkey generation algorithm
-- (Language::convertToSortkey()) to page_title, or cl_sortkey_prefix . "\0"
-- . page_title if cl_sortkey_prefix is nonempty.
- cl_sortkey varbinary(255) NOT NULL default '',
+ cl_sortkey varbinary(230) NOT NULL default '',
-- A prefix for the raw sortkey manually specified by the user, either via
-- [[Category:Foo|prefix]] or {{defaultsort:prefix}}. If nonempty, it's