Last modified: 2012-08-07 01:41:27 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 T41046, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39046 - Upgrade script for MySQL missing table msg_resource_links
Upgrade script for MySQL missing table msg_resource_links
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.19
All All
: Unprioritized critical (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-05 01:47 UTC by Patrick Uiterwijk
Modified: 2012-08-07 01:41 UTC (History)
2 users (show)

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


Attachments
This patch fixes the problem (840 bytes, patch)
2012-08-05 01:54 UTC, Patrick Uiterwijk
Details

Description Patrick Uiterwijk 2012-08-05 01:47:08 UTC
The upgrade script for MySQL (includes/installer/MysqlUpgrade.php) provided with MediaWiki 1.19.1 is missing the addtable for %{prefix}msg_resource_links.
This makes that an upgraded database trips over the large number of REPLACE INTO's for %{prefix}msg_resource.

This addtable statement IS available in the upgrade scripts for IBM DB2 and Oracle.
Comment 1 Patrick Uiterwijk 2012-08-05 01:54:51 UTC
Created attachment 10935 [details]
This patch fixes the problem
Comment 2 matanya 2012-08-05 10:22:41 UTC
Pushed you patch into Gerrit:

https://gerrit.wikimedia.org/r/#/c/17687/
Comment 3 Sam Reed (reedy) 2012-08-05 19:03:19 UTC
Per comments on gerrit, those additions are files for DB2, not for mysql
Comment 4 Sam Reed (reedy) 2012-08-05 19:08:04 UTC
patch-msg_resource.sql was added in 1.17

Contents:
-- Table for storing JSON message blobs for the resource loader
CREATE TABLE /*_*/msg_resource (
  -- Resource name
  mr_resource varbinary(255) NOT NULL,
  -- Language code 
  mr_lang varbinary(32) NOT NULL,
  -- JSON blob. This is an incomplete JSON object, i.e. without the wrapping {}
  mr_blob mediumblob NOT NULL,
  -- Timestamp of last update
  mr_timestamp binary(14) NOT NULL
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/mr_resource_lang ON /*_*/msg_resource(mr_resource, mr_lang);

-- Table for administering which message is contained in which resource
CREATE TABLE /*_*/msg_resource_links (
  mrl_resource varbinary(255) NOT NULL,
  -- Message key
  mrl_message varbinary(255) NOT NULL
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/mrl_message_resource ON /*_*/msg_resource_links (mrl_message, mrl_resource);


https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/installer/MysqlUpdater.php;h=9e7869ecb51c906deaedf3359a940495f2ace18a;hb=d0c0aabb3c5d40688d2435c0963927da479a47e0

Line 171

array( 'addTable', 'msg_resource',                      'patch-msg_resource.sql' ),


Did you run the updater?
Comment 5 Patrick Uiterwijk 2012-08-05 20:39:13 UTC
Yes, we did run the updater.
msg_resource was created, but apparently the whole problem is that the constraint over this table is NOT added.

This makes it trip because the REPLACE INTO msg_resource will just add a new row instead of replacing the old one.
We have ran into this issue at two different installations, both where missing this constraint.

We found this out because today it restarted tripping again, because the cache had expired.
Comment 6 Patrick Uiterwijk 2012-08-05 20:45:05 UTC
When looking again, the constraint should have been added by the sql script.
I think there have been some issues with the upgrade process.
Comment 7 Sam Reed (reedy) 2012-08-05 22:16:10 UTC
(In reply to comment #5)
> Yes, we did run the updater.
> msg_resource was created, but apparently the whole problem is that the
> constraint over this table is NOT added.
> 
> This makes it trip because the REPLACE INTO msg_resource will just add a new
> row instead of replacing the old one.
> We have ran into this issue at two different installations, both where missing
> this constraint.
> 
> We found this out because today it restarted tripping again, because the cache
> had expired.

Which constraint?
Comment 8 Patrick Uiterwijk 2012-08-07 01:41:27 UTC
msg_resource_language, the one constraint on msg_resource.

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


Navigation
Links