r74798 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74797‎ | r74798 | r74799 >
Date:21:47, 14 October 2010
Author:simetrical
Status:ok
Tags:
Comment:
cl_sortkey should be 230 bytes long, not 255

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.
Modified paths:
  • /trunk/phase3/maintenance/archives/patch-categorylinks-better-collation.sql (modified) (history)
  • /trunk/phase3/maintenance/archives/patch-categorylinks-better-collation2.sql (modified) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/patch-categorylinks-better-collation.sql
@@ -5,7 +5,7 @@
66 -- changes are also incorporated into patch-categorylinks-better-collation2.sql,
77 -- for the benefit of trunk users who applied the original.
88 ALTER TABLE /*$wgDBprefix*/categorylinks
9 - CHANGE COLUMN cl_sortkey cl_sortkey varbinary(255) NOT NULL default '',
 9+ CHANGE COLUMN cl_sortkey cl_sortkey varbinary(230) NOT NULL default '',
1010 ADD COLUMN cl_sortkey_prefix varchar(255) binary NOT NULL default '',
1111 ADD COLUMN cl_collation varbinary(32) NOT NULL default '',
1212 ADD COLUMN cl_type ENUM('page', 'subcat', 'file') NOT NULL default 'page',
Index: trunk/phase3/maintenance/archives/patch-categorylinks-better-collation2.sql
@@ -7,6 +7,6 @@
88 -- large table unnecessarily for people upgrading from 1.16, so this will be
99 -- skipped if unneeded.
1010 ALTER TABLE /*$wgDBprefix*/categorylinks
11 - CHANGE COLUMN cl_sortkey cl_sortkey varbinary(255) NOT NULL default '',
 11+ CHANGE COLUMN cl_sortkey cl_sortkey varbinary(230) NOT NULL default '',
1212 CHANGE COLUMN cl_collation cl_collation varbinary(32) NOT NULL default '';
1313 INSERT IGNORE INTO /*$wgDBprefix*/updatelog (ul_key) VALUES ('cl_fields_update');
Index: trunk/phase3/maintenance/tables.sql
@@ -492,7 +492,7 @@
493493 -- A binary string obtained by applying a sortkey generation algorithm
494494 -- (Language::convertToSortkey()) to page_title, or cl_sortkey_prefix . "\0"
495495 -- . page_title if cl_sortkey_prefix is nonempty.
496 - cl_sortkey varbinary(255) NOT NULL default '',
 496+ cl_sortkey varbinary(230) NOT NULL default '',
497497
498498 -- A prefix for the raw sortkey manually specified by the user, either via
499499 -- [[Category:Foo|prefix]] or {{defaultsort:prefix}}. If nonempty, it's

Status & tagging log