r18901 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r18900‎ | r18901 | r18902 >
Date:02:08, 7 January 2007
Author:tstarling
Status:old
Tags:
Comment:
Watchlist query group.
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/SpecialWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -2128,8 +2128,9 @@
21292129 * master (for write queries), DB_SLAVE for potentially lagged
21302130 * read queries, or an integer >= 0 for a particular server.
21312131 *
2132 - * @param array $groups Query groups. A list of group names that this query
2133 - * belongs to.
 2132+ * @param mixed $groups Query groups. An array of group names that this query
 2133+ * belongs to. May contain a single string if the query is only
 2134+ * in one group.
21342135 */
21352136 function &wfGetDB( $db = DB_LAST, $groups = array() ) {
21362137 global $wgLoadBalancer;
Index: trunk/phase3/includes/SpecialWatchlist.php
@@ -104,7 +104,7 @@
105105 $wgOut->addHTML( "</p>\n<p>" . wfMsg( 'wldone' ) . "</p>\n" );
106106 }
107107
108 - $dbr =& wfGetDB( DB_SLAVE );
 108+ $dbr =& wfGetDB( DB_SLAVE, 'watchlist' );
109109 list( $page, $watchlist, $recentchanges ) = $dbr->tableNamesN( 'page', 'watchlist', 'recentchanges' );
110110
111111 $sql = "SELECT COUNT(*) AS n FROM $watchlist WHERE wl_user=$uid";
@@ -435,7 +435,7 @@
436436 * @return integer
437437 */
438438 function wlCountItems( &$user, $talk = true ) {
439 - $dbr =& wfGetDB( DB_SLAVE );
 439+ $dbr =& wfGetDB( DB_SLAVE, 'watchlist' );
440440
441441 # Fetch the raw count
442442 $res = $dbr->select( 'watchlist', 'COUNT(*) AS count', array( 'wl_user' => $user->mId ), 'wlCountItems' );