From cca70eebf368c954a3de98d06d7bd707bbb3452c Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 8 Apr 2008 11:54:34 +0000 Subject: [PATCH] Don't use query groups for master connections --- includes/LoadBalancer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/LoadBalancer.php b/includes/LoadBalancer.php index 891f301e69..52fe9c1fea 100644 --- a/includes/LoadBalancer.php +++ b/includes/LoadBalancer.php @@ -364,7 +364,9 @@ class LoadBalancer { } # Query groups - if ( !is_array( $groups ) ) { + if ( $i == DB_MASTER ) { + $i = $this->getWriterIndex(); + } elseif ( !is_array( $groups ) ) { $groupIndex = $this->getReaderIndex( $groups, $wiki ); if ( $groupIndex !== false ) { $serverName = $this->getServerName( $groupIndex ); @@ -386,8 +388,6 @@ class LoadBalancer { # Operation-based index if ( $i == DB_SLAVE ) { $i = $this->getReaderIndex( false, $wiki ); - } elseif ( $i == DB_MASTER ) { - $i = $this->getWriterIndex(); } elseif ( $i == DB_LAST ) { # Just use $this->mLastIndex, which should already be set $i = $this->mLastIndex; -- 2.20.1