Archive for 'MediaWiki'

Looking for help with DB2 support in MediaWiki

MediaWiki is the PHP application underlying Wikipedia and other sites. Over the past couple years, I’ve spent some of my spare time to add DB2 support to it. Here’s where things stand now:

  • Working: Installing on DB2 using the old installer
  • Broken: Creating and editing articles
  • Not implemented: Search
  • Not implemented: Installing on DB2 using the new 1.17 installer

Implementing the installer was half the battle, as it required a fully functional DB2 database abstraction layer. I think the main issue with article editing right now are some data inconsistencies in the initial database.

However, MediaWiki is getting a new installer in 1.17. I’ll try to spend some time soon to establish the scope of adding DB2 support to it, and then start implementing.

My MediaWiki time is pretty limited, though. If you or someone you know can pitch in on debugging, maintaining, and expanding the DB2 support in it, I’d be very happy to bring you up to speed and review your initial patches.

Keep in mind that MediaWiki is GPL software.

Some links:

  • http://www.mediawiki.org/wiki/MediaWiki
  • http://www.mediawiki.org/wiki/How_to_become_a_MediaWiki_hacker
  • http://www.mediawiki.org/wiki/Commit_access
  • http://www.mediawiki.org/wiki/Manual:Coding_conventions
  • http://www.mediawiki.org/wiki/Manual:IBM_DB2

MediaWiki with DB2 support 1.16alpha

MediaWiki 1.15 was released with partial DB2 support, but unfortunately there were some changes to the database schema that I missed and it didn’t work out of the box. Since then, I’ve committed several fixes to the main development trunk. The trunk is currently destined to become 1.16alpha, though theoretically I could backport these to the 1.15 branch.

My Apache is currently crashing willy-nilly on startup. Hopefully, there are no silly development bugs left in.:-)

Continuing MediaWiki development

No fresh download quite yet, but I just made a large commit to the MediaWiki source of the last week’s work. This is going in the trunk — aka MediaWiki 1.16alpha. There are a few bugs I hope to catch this weekend, at which point I’ll put up a fresh archive of working code.

config/index.php:
* Made installation on IBM DB2 more robust
* Replaced E_ALL error reporting mode with E_ALL | E_STRICT

includes/db/DatabaseIbm_db2.php
* Enabled DB2_CASE_LOWER option for all connections and statements
* Enabled DB2_DEFERRED_PREPARE_ON for all statements — delays statement preparation until execution to reduce database load
* Enabled DB2_ROWCOUNT_PREFETCH_ON for all statements — makes db2_num_rows() work correctly
* Cleaned up error handling
* Cleaned up method signatures
* Rewrote insertion to use prepared statements — required for inserting more than 32k of text
* Insertion will never try to insert a NULL value into a primary key
* Now relying on implicit casting in DB2 9.7 — no longer sniffing to see if column is integer or string before adding quotes
* Implemented actual prepared statement handling — required for correct INSERT, UPDATE behaviour
* In install mode, the class will print additional messages to the install bullet scroll
* Added bitwise operation abstraction (BITNOT, BITAND, BITOR)

includes/specials/SpecialAncientpages.php
* Added skeleton DB2 syntax to the database-specific switch statement

maintenance/convertLinks.inc
* Made limit clause database-agnostic

maintenance/ibm_db2/README
* Contents replaced with link to http://www.mediawiki.org/wiki/Manual:IBM_DB2

maintenance/ibm_db2/tables.sql
* Revised types to better match the main schema
* All tables names now the same as MySQL — was using Postgres schema’s names before
* Added some additional indices
* Added the change_tag, tag_summary, valid_tag, user_properties, log_search, and l10n_cache tables
* Added several new columns

maintenance/storage/compressOld.inc
* Made limit clause database-agnostic

IBM DB2 patch for MediaWIki

MediaWiki is the software that powers sites like Wikipedia, Ubuntu Help Wiki, and many others.

In my spare time, I’ve written a patch to add IBM DB2 support to the development trunk. Hopefully, it will be added to the official source soon.

In the meantime:

There is a very good reason for the filenames.

This is all under GPL, so don’t look at it if you work on closed-source wikis.;-)

Repair table failed. Please run repair table.

One of the tables of my MediaWiki installation crashed. When I tried to repair it, I got this less-than-helpful error message. So did the mysqlcheck utility when I SSHed to the server. However, the command has extra options that can be used to repair high levels of corruptions, such as when the MYI is missing.

REPAIR TABLE tablename USE_FRM;