Last modified: 2012-08-04 20:48:45 UTC
I upgraded a mediawiki installation from 1.16-alpha to 1.17-alpha@72382. After opening any Category page I get an error: -------------------------------------------------------------------------- SELECT page_id,page_title,page_namespace,page_len,page_is_redirect,cl_sortkey,cat_id,cat_title,cat_subcats,cat_pages,cat_files,cl_sortkey_prefix FROM page INNER JOIN categorylinks ON ((cl_from = page_id)) LEFT JOIN category ON ((cat_title = page_title AND page_namespace = 14)) WHERE cl_to = 'category-name' AND cl_type = 'page' ORDER BY cl_sortkey LIMIT 201 ; ERROR: column "cl_sortkey_prefix" does not exist LINE 1: ...,cat_id,cat_title,cat_subcats,cat_pages,cat_files,cl_sortkey... ^ -------------------------------------------------------------------------- and the call site is in CategoryPage.php function doCategoryQuery(). I think that the cause is pretty simple: in commit 72026 new columns were added: + cl_sortkey_prefix TEXT NOT NULL DEFAULT '', + cl_collation SMALLINT NOT NULL DEFAULT 0, + cl_type TEXT NOT NULL DEFAULT 'page' I think that the fix is pretty simple: add the missing columns when running maintenance/update.php: ALTER TABLE categorylinks ADD COLUMN cl_sortkey_prefix TEXT NOT NULL DEFAULT ''; ALTER TABLE categorylinks ADD COLUMN cl_collation SMALLINT NOT NULL DEFAULT 0; ALTER TABLE categorylinks ADD COLUMN cl_type TEXT NOT NULL DEFAULT 'page'; Seem to work after this change :)
The patch file seems to exist (/phase3/maintenance/postgres/archives/patch-categorylinks-better-collation.sql). Can't seem to find the entry in the updaters list though.
It was added when the categorylinks collation was still experimental so it wasn't added to the automagic updates list since the design wasn't stable yet. Every time the schema changed having a way to updated from each old version to the current would be messy.
(In reply to comment #2) > It was added when the categorylinks collation was still experimental so it > wasn't added to the automagic updates list since the design wasn't stable yet. > Every time the schema changed having a way to updated from each old version to > the current would be messy. That's what people get for running trunk, the schema can change ;-) In general, this would be one of the (many many) reasons I want a sane schema generator/updater/thingie.
Fixed in r72593
(In reply to comment #4) > Fixed in r72593 Thanks!