$this->mPassword = $password;
$this->mDBname = $dbName;
- wfProfileIn( "dbconnect-$server" );
-
# The kernel's default SYN retransmission period is far too slow for us,
# so we use a short timeout plus a manual retry. Retrying means that a small
# but finite rate of SYN packet loss won't cause user-visible errors.
try {
$this->mConn = $this->mysqlConnect( $realServer );
} catch ( Exception $ex ) {
- wfProfileOut( "dbconnect-$server" );
$this->restoreErrorHandler();
throw $ex;
}
$error = $this->restoreErrorHandler();
- wfProfileOut( "dbconnect-$server" );
-
# Always log connection errors
if ( !$this->mConn ) {
if ( !$error ) {
"Server: $server, User: $user, Password: " .
substr( $password, 0, 3 ) . "..., error: " . $error . "\n" );
-
$this->reportConnectionError( $error );
}
wfDebug( "Error selecting database $dbName on server {$this->mServer} " .
"from client host " . wfHostname() . "\n" );
-
$this->reportConnectionError( "Error selecting database $dbName" );
}
}
}
}
-
return $status;
}