Fix wfWaitForSlaves() for foreign DBs
authorCatrope <roan.kattouw@gmail.com>
Thu, 21 Mar 2013 00:43:44 +0000 (17:43 -0700)
committerCatrope <roan.kattouw@gmail.com>
Thu, 21 Mar 2013 00:43:44 +0000 (17:43 -0700)
We thought we'd fixed it previously, but the LB now connects to the
foreign slaves and tries to select $wgDBname. Fixing this by having
doWait() open connections that don't select any DB name, by passing
the empty string as the DB name. This is an undocumented feature
in the DatabaseMysql constructor, apparently.

Change-Id: Icc5594143a3eaa31170a7fc8c93d429c1a7dd575

includes/db/LoadBalancer.php

index 1e85927..187870f 100644 (file)
@@ -407,7 +407,7 @@ class LoadBalancer {
                                wfDebug( __METHOD__ . ": no connection open\n" );
                                return false;
                        } else {
-                               $conn = $this->openConnection( $index );
+                               $conn = $this->openConnection( $index, '' );
                                if ( !$conn ) {
                                        wfDebug( __METHOD__ . ": failed to open connection\n" );
                                        return false;