From: Brad Jorsch Date: Thu, 2 May 2019 17:54:42 +0000 (-0700) Subject: SECURITY: LogPager: Don't STRAIGHT_JOIN when using log_search X-Git-Tag: 1.34.0-rc.0~1824 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/One?a=commitdiff_plain;h=77ca1430e4cab74dc7cf2db8553e9868836d0732;p=lhc%2Fweb%2Fwiklou.git SECURITY: LogPager: Don't STRAIGHT_JOIN when using log_search We'll hope MariaDB doesn't trigger T221458 in that situation. Bug: T222324 Signed-off-by: Scott Bassett Signed-off-by: James D. Forrester Change-Id: I06364e9d0bce45bd97b2ec837d1f479feff76699 --- diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php index 0eeb544eb3..4ecc368d4e 100644 --- a/includes/logging/LogPager.php +++ b/includes/logging/LogPager.php @@ -337,9 +337,9 @@ class LogPager extends ReverseChronologicalPager { // T221458: MySQL/MariaDB (10.1.37) can sometimes irrationally decide that querying `actor` before // `logging` and filesorting is somehow better than querying $limit+1 rows from `logging`. - // Tell it not to reorder the query. But not when tag filtering was used, as it seems as likely - // to be harmed as helped in that case. - if ( !$this->mTagFilter ) { + // Tell it not to reorder the query. But not when tag filtering or log_search was used, as it + // seems as likely to be harmed as helped in that case. + if ( !$this->mTagFilter && !array_key_exists( 'ls_field', $this->mConds ) ) { $options[] = 'STRAIGHT_JOIN'; }