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)

This commit is contained in:
Chad Horohoe 2011-01-06 19:25:47 +00:00
parent 4cd08cba20
commit 60e537e774
4 changed files with 4 additions and 8 deletions

View 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
/**@}*/
/**@{

View 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 );

View 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;

View file

@ -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