From: Catrope Date: Thu, 21 Mar 2013 00:43:44 +0000 (-0700) Subject: Fix wfWaitForSlaves() for foreign DBs X-Git-Tag: 1.31.0-rc.0~20266 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22statistiques_visites%22%2C%22%22%29%20.%20%22?a=commitdiff_plain;h=319ace81250b97dff0e6ee6df4b1f570f468bf5c;p=lhc%2Fweb%2Fwiklou.git Fix wfWaitForSlaves() for foreign DBs 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 --- diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index 1e85927826..187870fdbe 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -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;