r106373 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106372‎ | r106373 | r106374 >
Date:21:21, 15 December 2011
Author:platonides
Status:reverted (Comments)
Tags:
Comment:
Simplify a bit the code of r106025
Modified paths:
  • /trunk/phase3/includes/db/DatabasePostgres.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabasePostgres.php
@@ -642,11 +642,13 @@
643643 # Split database and table into proper variables.
644644 # We reverse the explode so that schema.table and table both output
645645 # the correct table.
646 - $dbDetails = array_reverse( explode( '.', $name, 2 ) );
 646+ $dbDetails = explode( '.', $name, 2 );
647647 if ( isset( $dbDetails[1] ) ) {
648 - list( $table, $schema ) = $dbDetails;
 648+ $schema = '"' . $dbDetails[0] . '".';
 649+ $table = $dbDetails [1];
649650 } else {
650 - list( $table ) = $dbDetails;
 651+ $schema = "\"{$wgDBmwschema}\"."; # keep old schema, but quote it.
 652+ $table = $dbDetails[0];
651653 }
652654 if ( $format != 'quoted' ) {
653655 switch( $name ) {
@@ -658,12 +660,7 @@
659661 return $table;
660662 }
661663 }
662 - if ( !isset( $schema )) {
663 - $schema = "\"{$wgDBmwschema}\".";
664 - } else {
665 - # keep old schema, but quote it.
666 - $schema = "\"{$schema}\".";
667 - }
 664+
668665 # during installation wgDBmwschema is not set, so we would end up quering
669666 # ""."table" => error. Erase the first part if wgDBmwschema is empty
670667 if ( $schema == "\"\"." ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r106419Foooollowup r106373 - update commentnikerabbit08:56, 16 December 2011
r110690Reverted r106025 and friends (r106370, r106373, r108060, r108337, r106419). T...aaron23:37, 3 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r106025Bug 16794 - $wgSharedDB PostgreSQL support...mah15:06, 13 December 2011

Comments

#Comment by Nikerabbit (talk | contribs)   07:21, 16 December 2011

Comment needs updating too.

Status & tagging log