Watchlist query group.
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 7 Jan 2007 02:08:55 +0000 (02:08 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 7 Jan 2007 02:08:55 +0000 (02:08 +0000)
includes/GlobalFunctions.php
includes/SpecialWatchlist.php

index cb91e54..24e60ca 100644 (file)
@@ -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;
index b4bd5cc..33e19a2 100644 (file)
@@ -104,7 +104,7 @@ function wfSpecialWatchlist( $par ) {
                $wgOut->addHTML( "</p>\n<p>" . wfMsg( 'wldone' ) . "</p>\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' );