Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -376,24 +376,21 @@ |
377 | 377 | $error = $phpError; |
378 | 378 | } |
379 | 379 | wfLogDBError( "Error connecting to {$this->mServer}: $error\n" ); |
| 380 | + wfDebug( "DB connection error\n" ); |
| 381 | + wfDebug( "Server: $server, User: $user, Password: " . |
| 382 | + substr( $password, 0, 3 ) . "..., error: " . mysql_error() . "\n" ); |
| 383 | + $success = false; |
380 | 384 | } |
381 | 385 | |
382 | 386 | wfProfileOut("dbconnect-$server"); |
383 | 387 | |
384 | | - if ( $dbName != '' ) { |
385 | | - if ( $this->mConn !== false ) { |
386 | | - $success = @/**/mysql_select_db( $dbName, $this->mConn ); |
387 | | - if ( !$success ) { |
388 | | - $error = "Error selecting database $dbName on server {$this->mServer} " . |
389 | | - "from client host {$wguname['nodename']}\n"; |
390 | | - wfLogDBError(" Error selecting database $dbName on server {$this->mServer} \n"); |
391 | | - wfDebug( $error ); |
392 | | - } |
393 | | - } else { |
394 | | - wfDebug( "DB connection error\n" ); |
395 | | - wfDebug( "Server: $server, User: $user, Password: " . |
396 | | - substr( $password, 0, 3 ) . "..., error: " . mysql_error() . "\n" ); |
397 | | - $success = false; |
| 388 | + if ( $dbName != '' && $this->mConn !== false ) { |
| 389 | + $success = @/**/mysql_select_db( $dbName, $this->mConn ); |
| 390 | + if ( !$success ) { |
| 391 | + $error = "Error selecting database $dbName on server {$this->mServer} " . |
| 392 | + "from client host {$wguname['nodename']}\n"; |
| 393 | + wfLogDBError(" Error selecting database $dbName on server {$this->mServer} \n"); |
| 394 | + wfDebug( $error ); |
398 | 395 | } |
399 | 396 | } else { |
400 | 397 | # Delay USE query |
Index: trunk/phase3/includes/db/LoadBalancer.php |
— | — | @@ -663,6 +663,7 @@ |
664 | 664 | $reporting = true; |
665 | 665 | if ( !is_object( $conn ) ) { |
666 | 666 | // No last connection, probably due to all servers being too busy |
| 667 | + wfLogDBError( "LB failure with no last connection\n" ); |
667 | 668 | $conn = new Database; |
668 | 669 | if ( $this->mFailFunction ) { |
669 | 670 | $conn->failFunction( $this->mFailFunction ); |
— | — | @@ -678,6 +679,7 @@ |
679 | 680 | $conn->failFunction( false ); |
680 | 681 | } |
681 | 682 | $server = $conn->getProperty( 'mServer' ); |
| 683 | + wfLogDBError( "Connection error: {$this->mLastError} ({$server})\n" ); |
682 | 684 | $conn->reportConnectionError( "{$this->mLastError} ({$server})" ); |
683 | 685 | } |
684 | 686 | $reporting = false; |