From: Chad Horohoe Date: Thu, 6 Jan 2011 19:25:47 +0000 (+0000) Subject: Fixes for r75545: don't use MEDIAWIKI_INSTALL in the updaters classes, it's not what... X-Git-Tag: 1.31.0-rc.0~32751 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=60e537e7741580a71b52530d0ea3b0e65b1b82ff;p=lhc%2Fweb%2Fwiklou.git Fixes for r75545: don't use MEDIAWIKI_INSTALL in the updaters classes, it's not what it's for. Add new DBO_DDLMODE flag which does the same thing (and moved it up to DatabaseUpdater, in case any other children need it) --- diff --git a/includes/Defines.php b/includes/Defines.php index 32758661f8..64197d9c48 100644 --- a/includes/Defines.php +++ b/includes/Defines.php @@ -19,6 +19,7 @@ define( 'DBO_TRX', 8 ); define( 'DBO_DEFAULT', 16 ); define( 'DBO_PERSISTENT', 32 ); define( 'DBO_SYSDBA', 64 ); //for oracle maintenance +define( 'DBO_DDLMODE', 128 ); // when using schema files: mostly for Oracle /**@}*/ /**@{ diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 00be0f1404..e15a8f0b4f 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -311,9 +311,10 @@ class DatabaseOracle extends DatabaseBase { // handle some oracle specifics // remove AS column/table/subquery namings - if ( !defined( 'MEDIAWIKI_INSTALL' ) ) { + if( !$this->getFlag( DBO_DDLMODE ) ) { $sql = preg_replace( '/ as /i', ' ', $sql ); } + // Oracle has issues with UNION clause if the statement includes LOB fields // So we do a UNION ALL and then filter the results array with array_unique $union_unique = ( preg_match( '/\/\* UNION_UNIQUE \*\/ /', $sql ) != 0 ); diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index b13331939d..badcc640cc 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -48,6 +48,7 @@ abstract class DatabaseUpdater { */ protected function __construct( DatabaseBase &$db, $shared, Maintenance $maintenance = null ) { $this->db = $db; + $this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files $this->shared = $shared; if ( $maintenance ) { $this->maintenance = $maintenance; diff --git a/includes/installer/OracleUpdater.php b/includes/installer/OracleUpdater.php index ddfd67db14..cb41e8e9bd 100644 --- a/includes/installer/OracleUpdater.php +++ b/includes/installer/OracleUpdater.php @@ -13,12 +13,6 @@ * @since 1.17 */ class OracleUpdater extends DatabaseUpdater { - - protected function __construct( DatabaseBase &$db, $shared ) { - define( 'MEDIAWIKI_INSTALL', true ); - parent::__construct( $db, $shared ); - } - protected function getCoreUpdateList() { return array( // 1.16 @@ -29,7 +23,6 @@ class OracleUpdater extends DatabaseUpdater { ); } - /** * MySQL uses datatype defaults for NULL inserted into NOT NULL fields * In namespace case that results into insert of 0 which is default namespace