Last modified: 2014-10-23 07:21:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T71360, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 69360 - missing 'patch-add_interwiki.sql' for the includes/installer/PostgresqlUpdater.php
missing 'patch-add_interwiki.sql' for the includes/installer/PostgresqlUpdate...
Status: UNCONFIRMED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.24rc
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
aklapper-moreinfo
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2014-08-10 09:35 UTC by Anton Kochkov
Modified: 2014-10-23 07:21 UTC (History)
2 users (show)

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


Attachments

Description Anton Kochkov 2014-08-10 09:35:42 UTC
See the last functions in the file 'includes/installer/PostgresqlUpdater.php':

protected function addInterwikiType() {
$this->applyPatch( 'patch-add_interwiki.sql', false, "Refreshing add_interwiki()" );
}
protected function tsearchFixes() {
# Tweak the page_title tsearch2 trigger to filter out slashes
# This is create or replace, so harmless to call if not needed
$this->applyPatch( 'patch-ts2pagetitle.sql', false, "Refreshing ts2_page_title()" );
# If the server is 8.3 or higher, rewrite the tsearch2 triggers
# in case they have the old 'default' versions
# Gather version numbers in case we need them
if ( $this->db->getServerVersion() >= 8.3 ) {
$this->applyPatch( 'patch-tsearch2funcs.sql', false, "Rewriting tsearch2 triggers" );
}
}

All these *.sql files are missing. Moreover, addInterwikiType() calls even if interwiki table already exists.

Also patch-interwiki.sql for PostgreSQL should be:

CREATE TABLE /*$wgDBprefix*/interwiki (
-- The interwiki prefix, (e.g. "Meatball", or the language prefix "de")
iw_prefix varchar(32) NOT NULL,
-- The URL of the wiki, with "$1" as a placeholder for an article name.
-- Any spaces in the name will be transformed to underscores before
-- insertion.
iw_url byteea NOT NULL,
-- A boolean value indicating whether the wiki is in this project
-- (used, for example, to detect redirect loops)
iw_local BOOL NOT NULL,
PRIMARY KEY (iw_prefix),
UNIQUE (iw_prefix)
) /*$wgDBTableOptions*/;

But this is could be wrong too - upgrade script suggests that iw_local column translating into smallint type, so it should be already smallint from the start (bool->smallint translation is not allowed, afair).

So these SQL files and updater scripts should be syncronised for consistency.
Comment 1 Andre Klapper 2014-08-10 16:37:26 UTC
Thanks for taking the time to report this!

In case you (or anybody) feel like cooking up a patch, you are welcome to use Developer access
  https://www.mediawiki.org/wiki/Developer_access
to submit this as a Git branch directly into Gerrit:
  https://www.mediawiki.org/wiki/Git/Tutorial
If you don't want to set up Git/Gerrit, you can also use https://tools.wmflabs.org/gerrit-patch-uploader/
Comment 2 Marcin Cieślak 2014-08-26 14:30:45 UTC
Is there any way you keep getting an error message? 
A year ago I did extensive tests attempting to upgrade pretty various old PostgreSQL MediaWikis into something more recent.

How old is your MediaWiki? How old is your PostgreSQL installation?

Would that be possible for you to dump a schema of the database somewhere for me to test? (or even a whole DB if not private)?


Assuming you have a question related to the code:


This code relates to the "add_interwiki" SQL *function*, not table.
"interwiki" TABLE (with iw_local as CHAR NOT NULL) existed forever
in the history of the PostgreSQL port - the first checkin of the tables.sql
files contains the table already. Only later some fields where changed
(iw_local became SMALLINT as you mention) or were added, and this seems
to be reflected in the PostgresUpdater.

The code to add "add_interwiki" function lives in maintenance/postgres/archives/patch-add_interwiki.sql and seems to be fine to me.
Comment 3 Andre Klapper 2014-10-23 07:21:06 UTC
Anton: Can you please answer comment 2?

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


Navigation
Links