? $params['queryLogger']
: new \Psr\Log\NullLogger();
+ // Set initial dummy domain until open() sets the final DB/prefix
+ $this->currentDomain = DatabaseDomain::newUnspecified();
+
if ( $user ) {
$this->open( $server, $user, $password, $dbName );
} elseif ( $this->requiresDatabaseUser() ) {
}
// Set the domain object after open() sets the relevant fields
- $this->currentDomain = ( $this->mDBname != '' )
- ? new DatabaseDomain( $this->mDBname, null, $this->mTablePrefix )
- : DatabaseDomain::newUnspecified();
+ if ( $this->mDBname != '' ) {
+ // Domains with server scope but a table prefix are not used by IDatabase classes
+ $this->currentDomain = new DatabaseDomain( $this->mDBname, null, $this->mTablePrefix );
+ }
}
/**