From: Christian Aistleitner Date: Mon, 28 May 2012 20:06:43 +0000 (+0200) Subject: Fix error message for MySQL connection failures X-Git-Tag: 1.31.0-rc.0~23379^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/voir.php?a=commitdiff_plain;h=af919fe3e0c9c847de0ebbeea3659186be9d541d;p=lhc%2Fweb%2Fwiklou.git Fix error message for MySQL connection failures Change-Id: I23cbe6a58ab5aed88c656bfa9370568b39ca4e32 --- diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index 8550635a39..1d03073b15 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -113,14 +113,14 @@ class DatabaseMysql extends DatabaseBase { $phpError = $this->restoreErrorHandler(); # Always log connection errors if ( !$this->mConn ) { - $error = $this->lastError(); + $error = $phpError; if ( !$error ) { - $error = $phpError; + $error = $this->lastError(); } wfLogDBError( "Error connecting to {$this->mServer}: $error\n" ); wfDebug( "DB connection error\n" ); wfDebug( "Server: $server, User: $user, Password: " . - substr( $password, 0, 3 ) . "..., error: " . mysql_error() . "\n" ); + substr( $password, 0, 3 ) . "..., error: " . $error . "\n" ); } wfProfileOut("dbconnect-$server");