r79745 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79744‎ | r79745 | r79746 >
Date:19:25, 6 January 2011
Author:demon
Status:ok
Tags:
Comment:
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)
Modified paths:
  • /trunk/phase3/includes/Defines.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseOracle.php (modified) (history)
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)
  • /trunk/phase3/includes/installer/OracleUpdater.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Defines.php
@@ -19,6 +19,7 @@
2020 define( 'DBO_DEFAULT', 16 );
2121 define( 'DBO_PERSISTENT', 32 );
2222 define( 'DBO_SYSDBA', 64 ); //for oracle maintenance
 23+define( 'DBO_DDLMODE', 128 ); // when using schema files: mostly for Oracle
2324 /**@}*/
2425
2526 /**@{
Index: trunk/phase3/includes/db/DatabaseOracle.php
@@ -311,9 +311,10 @@
312312
313313 // handle some oracle specifics
314314 // remove AS column/table/subquery namings
315 - if ( !defined( 'MEDIAWIKI_INSTALL' ) ) {
 315+ if( !$this->getFlag( DBO_DDLMODE ) ) {
316316 $sql = preg_replace( '/ as /i', ' ', $sql );
317317 }
 318+
318319 // Oracle has issues with UNION clause if the statement includes LOB fields
319320 // So we do a UNION ALL and then filter the results array with array_unique
320321 $union_unique = ( preg_match( '/\/\* UNION_UNIQUE \*\/ /', $sql ) != 0 );
Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -48,6 +48,7 @@
4949 */
5050 protected function __construct( DatabaseBase &$db, $shared, Maintenance $maintenance = null ) {
5151 $this->db = $db;
 52+ $this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files
5253 $this->shared = $shared;
5354 if ( $maintenance ) {
5455 $this->maintenance = $maintenance;
Index: trunk/phase3/includes/installer/OracleUpdater.php
@@ -13,12 +13,6 @@
1414 * @since 1.17
1515 */
1616 class OracleUpdater extends DatabaseUpdater {
17 -
18 - protected function __construct( DatabaseBase &$db, $shared ) {
19 - define( 'MEDIAWIKI_INSTALL', true );
20 - parent::__construct( $db, $shared );
21 - }
22 -
2317 protected function getCoreUpdateList() {
2418 return array(
2519 // 1.16
@@ -29,7 +23,6 @@
3024 );
3125 }
3226
33 -
3427 /**
3528 * MySQL uses datatype defaults for NULL inserted into NOT NULL fields
3629 * In namespace case that results into insert of 0 which is default namespace

Follow-up revisions

RevisionCommit summaryAuthorDate
r801901.17: MFT first batch of installer changes: r78043, r78231, r78259, r78300, r...catrope20:47, 13 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75545* installers skips recreation of existing user...freakolowsky14:52, 27 October 2010

Status & tagging log