From af919fe3e0c9c847de0ebbeea3659186be9d541d Mon Sep 17 00:00:00 2001 From: Christian Aistleitner Date: Mon, 28 May 2012 22:06:43 +0200 Subject: [PATCH] Fix error message for MySQL connection failures Change-Id: I23cbe6a58ab5aed88c656bfa9370568b39ca4e32 --- includes/db/DatabaseMysql.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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"); -- 2.20.1