Jens Frank wrote:
MySQL has some strange "enhancements" to SQL that are not compatible to the rest of the world. With dammit's port to PostgreSQL, these spots were identified and using a global ($wgIsPg I think it's named) the MySQL-specific instructions can be disabled. This should be a good starting point for a port to Oracle. PostgreSQL handles sequences the same way Oracle does, so that our usage of MySQL's auto_increment columns has already been ported, too. The PostgreSQL port is in the latest 1.3 betas.
I've rewritten most of the PostgreSQL port in my working copy, it hasn't been committed yet. I'm also changing the way we call the database throughout the codebase. I'm holding my breath hoping people don't make too many commits, because at this stage pretty much any change will cause conflicts. You can see where I'm up to at:
http://www.ph.unimelb.edu.au/~tstarling/half-completed_DB_OOP.patch
I've decided to cut short the OOP and table name modifications, do some testing, and then commit it, before completing the conversion. It will still work when it's half-converted.
The problem with $wgIsXxxx was that it would have required just as much work to implement a port to a third DBMS as it did to implement the second. Instead of DBMS-dependent conditions scattered throughout the codebase, I'm working on having common functions which are efficient for MySQL but can be emulated by any DBMS. I don't know exactly how Oracle differs from PostgreSQL and MySQL, but hopefully the bulk of the work to produce a port should be in the DatabaseOracle subclass rather than throughout the code.
-- Tim Starling