r84765 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84764‎ | r84765 | r84766 >
Date:21:05, 25 March 2011
Author:btongminh
Status:resolved (Comments)
Tags:post1.18deploy 
Comment:
(bug 28070) Fix watchlist RSS for databases that store timestamps in a real timestamp field by using Database::timestamp(). Tested by Dan Nessett on 1.16. Not tested on trunk, but no reason why it should not work.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryWatchlist.php
@@ -128,8 +128,12 @@
129129 'wl_user' => $userId,
130130 'rc_deleted' => 0,
131131 ) );
 132+
 133+ $db = $this->getDB();
132134
133 - $this->addWhereRange( 'rc_timestamp', $params['dir'], $params['start'], $params['end'] );
 135+ $this->addWhereRange( 'rc_timestamp', $params['dir'],
 136+ $db->timestamp( $params['start'] ),
 137+ $db->timestamp( $params['end'] ) );
134138 $this->addWhereFld( 'wl_namespace', $params['namespace'] );
135139 $this->addWhereIf( 'rc_this_oldid=page_latest', !$params['allrev'] );
136140
@@ -175,7 +179,7 @@
176180 $this->addWhere( 'rc_user_text != ' . $this->getDB()->addQuotes( $params['excludeuser'] ) );
177181 }
178182
179 - $db = $this->getDB();
 183+
180184
181185 // This is an index optimization for mysql, as done in the Special:Watchlist page
182186 $this->addWhereIf( "rc_timestamp > ''", !isset( $params['start'] ) && !isset( $params['end'] ) && $db->getType() == 'mysql' );
Index: trunk/phase3/RELEASE-NOTES
@@ -283,6 +283,8 @@
284284 * (bug 27586) Remove duplication of props in ApiQueryStashImageInfo
285285 by using ApiQueryImageInfo
286286 * (bug 28226) prop=extlinks&eloffset should be an integer
 287+* (bug 28070) Fix watchlist RSS for databases that store timestamps in a
 288+ real timestamp field.
287289
288290 === Languages updated in 1.18 ===
289291

Sign-offs

UserFlagDate
Hasharinspected12:06, 26 March 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r85435MFT: r84431, r84464, r84543, r84553, r84573, r84574, r84577, r84729, r84765, ...demon14:00, 5 April 2011
r99236Follow-up r84765, use timestampOrNullbtongminh19:11, 7 October 2011
r99480(bug 31526) Per r84765 CR, change timestamp() to timestampOrNull().catrope15:07, 11 October 2011

Comments

#Comment by MaxSem (talk | contribs)   17:32, 7 October 2011

This change resulted in query returning an empty set when start and end are not set, e.g. https://en.wikipedia.org/w/api.php?action=query&list=watchlist

it generates the following broken conditions:

(rc_timestamp<='20111007170203') AND (rc_timestamp>='20111007170203')
#Comment by Bryan (talk | contribs)   19:19, 7 October 2011

Follow-up in r99236, but that one requires an intermediate revision r99138. Alternatively the timestamp() call should be changed to timestampOrNull()

Status & tagging log