r42039 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r42038‎ | r42039 | r42040 >
Date:18:38, 13 October 2008
Author:ialex
Status:old (Comments)
Tags:
Comment:
Revert r41506 and make LoadBalancer::openForeignConnection() call Database::tablePrefix() on successful new connection
Modified paths:
  • /trunk/phase3/includes/db/LoadBalancer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/LoadBalancer.php
@@ -598,6 +598,7 @@
599599 $this->mErrorConnection = $conn;
600600 $conn = false;
601601 } else {
 602+ $conn->tablePrefix( $prefix );
602603 $this->mConns['foreignUsed'][$i][$wiki] = $conn;
603604 wfDebug( __METHOD__.": opened new connection for $i/$wiki\n" );
604605 }
@@ -638,17 +639,12 @@
639640 $dbname = $dbNameOverride;
640641 }
641642
642 - if( !isset( $prefix ) ){
643 - global $wgDBprefix;
644 - $prefix = $wgDBprefix;
645 - }
646 -
647643 # Get class for this database type
648644 $class = 'Database' . ucfirst( $type );
649645
650646 # Create object
651647 wfDebug( "Connecting to $host $dbname...\n" );
652 - $db = new $class( $host, $user, $password, $dbname, 1, $flags, $prefix );
 648+ $db = new $class( $host, $user, $password, $dbname, 1, $flags );
653649 if ( $db->isOpen() ) {
654650 wfDebug( "Connected\n" );
655651 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r41506Allow to specify per connection table prefixialex16:39, 1 October 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   19:02, 13 October 2008

Sounds legit enough...

($wgDBprefix will be used by DB constructor if not provided explicitly, so dropping it here seems ok.)

Status & tagging log