Merge "Use MWLogger logging for wfLogProfilingData"
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 55e6e27..67c1586 100644 (file)
@@ -30,7 +30,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 /**
  * Compatibility functions
  *
- * We support PHP 5.3.2 and up.
+ * We support PHP 5.3.3 and up.
  * Re-implementations of newer functions or functions in non-standard
  * PHP extensions may be included here.
  */
@@ -3710,7 +3710,7 @@ function wfWaitForSlaves(
        // Figure out which clusters need to be checked
        $lbs = array();
        if ( $cluster === '*' ) {
-               wfGetLBFactory()->forEachLB( function( LoadBalancer $lb ) use ( &$lbs ) {
+               wfGetLBFactory()->forEachLB( function ( LoadBalancer $lb ) use ( &$lbs ) {
                        $lbs[] = $lb;
                } );
        } elseif ( $cluster !== false ) {
@@ -3730,7 +3730,9 @@ function wfWaitForSlaves(
                        if ( $ifWritesSince && !$lb->hasMasterConnection() ) {
                                continue; // assume no writes done
                        }
-                       $dbw = $lb->getConnection( DB_MASTER, array(), $wiki );
+                       // Use the empty string to not trigger selectDB() since the connection
+                       // may have been to a server that does not have a DB for the current wiki.
+                       $dbw = $lb->getConnection( DB_MASTER, array(), '' );
                        if ( $ifWritesSince && $dbw->lastDoneWrites() < $ifWritesSince ) {
                                continue; // no writes since the last wait
                        }