Last modified: 2012-08-04 20:48:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 25080 - categorylinks table is not updated during upgrade (postgresql)
categorylinks table is not updated during upgrade (postgresql)
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.17.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2010-09-06 13:20 UTC by zbyszek
Modified: 2012-08-04 20:48 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description zbyszek 2010-09-06 13:20:04 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 :)
Comment 1 Chad H. 2010-09-08 15:32:52 UTC
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.
Comment 2 OverlordQ 2010-09-08 16:13:29 UTC
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.
Comment 3 Chad H. 2010-09-08 17:48:52 UTC
(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.
Comment 4 Greg Sabino Mullane 2010-09-08 20:11:32 UTC
Fixed in r72593
Comment 5 zbyszek 2010-09-08 20:14:19 UTC
(In reply to comment #4)
> Fixed in r72593

Thanks!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links