* This convention to avoid selecting a DB is already supported for
new connections but not when an existing foreign wiki connection
is reused. This avoids giving PHP notices.
Change-Id: Ic6e9ed031bc8ea6d6f519b6998f0414364c087d0
$conn = reset( $this->mConns['foreignFree'][$i] );
$oldWiki = key( $this->mConns['foreignFree'][$i] );
- if ( !$conn->selectDB( $dbName ) ) {
+ // The empty string as a DB name means "don't care".
+ // DatabaseMysqlBase::open() already handle this on connection.
+ if ( $dbName !== '' && !$conn->selectDB( $dbName ) ) {
$this->mLastError = "Error selecting database $dbName on server " .
$conn->getServer() . " from client host " . wfHostname() . "\n";
$this->mErrorConnection = $conn;