From c637d59c92450df88c0016c4528a12d85d2b00fb Mon Sep 17 00:00:00 2001
From: Tim Starling
Date: Sun, 7 Jan 2007 02:08:55 +0000
Subject: [PATCH] Watchlist query group.
---
includes/GlobalFunctions.php | 5 +++--
includes/SpecialWatchlist.php | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php
index cb91e546f0..24e60cafa9 100644
--- a/includes/GlobalFunctions.php
+++ b/includes/GlobalFunctions.php
@@ -2128,8 +2128,9 @@ function wfWikiID() {
* master (for write queries), DB_SLAVE for potentially lagged
* read queries, or an integer >= 0 for a particular server.
*
- * @param array $groups Query groups. A list of group names that this query
- * belongs to.
+ * @param mixed $groups Query groups. An array of group names that this query
+ * belongs to. May contain a single string if the query is only
+ * in one group.
*/
function &wfGetDB( $db = DB_LAST, $groups = array() ) {
global $wgLoadBalancer;
diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php
index b4bd5cc3d7..33e19a2bdb 100644
--- a/includes/SpecialWatchlist.php
+++ b/includes/SpecialWatchlist.php
@@ -104,7 +104,7 @@ function wfSpecialWatchlist( $par ) {
$wgOut->addHTML( "
\n" . wfMsg( 'wldone' ) . "
\n" );
}
- $dbr =& wfGetDB( DB_SLAVE );
+ $dbr =& wfGetDB( DB_SLAVE, 'watchlist' );
list( $page, $watchlist, $recentchanges ) = $dbr->tableNamesN( 'page', 'watchlist', 'recentchanges' );
$sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_user=$uid";
@@ -435,7 +435,7 @@ function wlCutoffLinks( $days, $page = 'Watchlist', $options = array() ) {
* @return integer
*/
function wlCountItems( &$user, $talk = true ) {
- $dbr =& wfGetDB( DB_SLAVE );
+ $dbr =& wfGetDB( DB_SLAVE, 'watchlist' );
# Fetch the raw count
$res = $dbr->select( 'watchlist', 'COUNT(*) AS count', array( 'wl_user' => $user->mId ), 'wlCountItems' );
--
2.20.1