If a caller gives an empty array for $targetsWithVisitThresholds, per
the documentation it should be expecting an empty array in return, not a
count of watchers for every title in the database.
Bug: T204729
Change-Id: I0f25fae301450d077bb30597281aaef0fba209d4
(cherry picked from commit
f5469d36602cb2a95396830b14e9a631d698f3a6)
+== MediaWiki 1.31.2 ==
+
+THIS IS NOT A RELEASE YET
+
+=== Changes since MediaWiki 1.31.1 ===
+* (T204729) WatchedItemStore::countVisitingWatchersMultiple() shouldn't query all
+ titles when asked for none
+
== MediaWiki 1.31.1 ==
This is a security and maintenance release of the MediaWiki 1.31 branch.
array $targetsWithVisitThresholds,
$minimumWatchers = null
) {
+ if ( $targetsWithVisitThresholds === [] ) {
+ // No titles requested => no results returned
+ return [];
+ }
+
$dbr = $this->getConnectionRef( DB_REPLICA );
$conds = $this->getVisitingWatchersCondition( $dbr, $targetsWithVisitThresholds );