Fixes for r75545: don't use MEDIAWIKI_INSTALL in the updaters classes, it's not what...
authorChad Horohoe <demon@users.mediawiki.org>
Thu, 6 Jan 2011 19:25:47 +0000 (19:25 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Thu, 6 Jan 2011 19:25:47 +0000 (19:25 +0000)
includes/Defines.php
includes/db/DatabaseOracle.php
includes/installer/DatabaseUpdater.php
includes/installer/OracleUpdater.php

index 3275866..64197d9 100644 (file)
@@ -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
 /**@}*/
 
 /**@{
index 00be0f1..e15a8f0 100644 (file)
@@ -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 );
index b133319..badcc64 100644 (file)
@@ -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;
index ddfd67d..cb41e8e 100644 (file)
  * @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