From: Tim Starling
Date: Sun, 7 Jan 2007 02:08:55 +0000 (+0000)
Subject: Watchlist query group.
X-Git-Tag: 1.31.0-rc.0~54623
X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=c637d59c92450df88c0016c4528a12d85d2b00fb;p=lhc%2Fweb%2Fwiklou.git
Watchlist query group.
---
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' );