r88488 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88487‎ | r88488 | r88489 >
Date:21:30, 20 May 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Similarise queries to that of SpecialWatchlist
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryWatchlist.php
@@ -115,17 +115,21 @@
116116 }
117117
118118 $this->addTables( array(
 119+ 'recentchanges',
119120 'watchlist',
120121 'page',
121 - 'recentchanges'
122122 ) );
123123
124124 $userId = $user->getId();
 125+ $this->addJoinConds( array( 'watchlist' => array('INNER JOIN',
 126+ array(
 127+ 'wl_user' => $userId,
 128+ 'wl_namespace=rc_namespace',
 129+ 'wl_title=rc_title'
 130+ ) ) ) );
 131+ $this->addJoinConds( array( 'page' => array( 'LEFT JOIN','rc_cur_id=page_id' ) ) );
 132+
125133 $this->addWhere( array(
126 - 'wl_namespace = rc_namespace',
127 - 'wl_title = rc_title',
128 - 'rc_cur_id = page_id',
129 - 'wl_user' => $userId,
130134 'rc_deleted' => 0,
131135 ) );
132136

Follow-up revisions

RevisionCommit summaryAuthorDate
r88493* (bug 20699) API watchlist should list log-events...reedy21:47, 20 May 2011
r94062Followup r88488, moved some of the prep work in it that was for r88493...reedy16:20, 8 August 2011

Comments

#Comment by Catrope (talk | contribs)   15:54, 2 June 2011

Doesn't this change the functional behavior of the query? The INNER JOIN part is fine, but the LEFT JOIN didn't use to be there.

#Comment by Reedy (talk | contribs)   15:36, 25 June 2011

I think this was prep work for r88493

I believe, related to

-		$this->addWhereIf( 'rc_this_oldid=page_latest', !$params['allrev'] );
+		$this->addWhereIf( 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG, !$params['allrev'] );

....


			# Top log Ids for a page are not stored
			$conds[] = 'rc_this_oldid=page_latest OR rc_type=' . RC_LOG;

Status & tagging log