aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api
diff options
context:
space:
mode:
authorTim Starling <tstarling@wikimedia.org>2021-05-07 13:56:53 +1000
committerTim Starling <tstarling@wikimedia.org>2021-05-07 13:56:53 +1000
commitcd6c7786a4d7d8a2bb72e8cb48c7e5df42a7a4b7 (patch)
tree6b2d7db2692719d0bffedee2306c7e6af579f8e1 /includes/api
parent35c0a9b783400e555cccbc045fc23820c8c19120 (diff)
downloadmediawikicore-cd6c7786a4d7d8a2bb72e8cb48c7e5df42a7a4b7.tar.gz
mediawikicore-cd6c7786a4d7d8a2bb72e8cb48c7e5df42a7a4b7.zip
ApiQueryLogEvents: when user is specified, omit STRAIGHT_JOIN
Otherwise it tries to scan the whole logging table, joining every row on actor. Bug: T282122 Change-Id: Ia34897a496656e0d0d26f9e038b1edb0377c461e
Diffstat (limited to 'includes/api')
-rw-r--r--includes/api/ApiQueryLogEvents.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php
index f3fc4fae1234..6a929689c68b 100644
--- a/includes/api/ApiQueryLogEvents.php
+++ b/includes/api/ApiQueryLogEvents.php
@@ -245,7 +245,8 @@ class ApiQueryLogEvents extends ApiQueryBase {
// `logging` and filesorting is somehow better than querying $limit+1 rows from `logging`.
// Tell it not to reorder the query. But not when `letag` was used, as it seems as likely
// to be harmed as helped in that case.
- if ( $params['tag'] === null ) {
+ // If "user" was specified, it's obviously correct to query actor first (T282122)
+ if ( $params['tag'] === null && $user === null ) {
$this->addOption( 'STRAIGHT_JOIN' );
}