X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Flogging%2FLogPager.php;h=0b78a3603307ddb647d824b8b5b4da1732663c9f;hb=f704207ba129198e21ada72c2961e5bd26ac3227;hp=47aed56a641cf0b724f3ba43f07cbbec6bcff649;hpb=8ac7621625acb014e48b064deddc704437ba5854;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/logging/LogPager.php b/includes/logging/LogPager.php index 47aed56a64..0b78a36033 100644 --- a/includes/logging/LogPager.php +++ b/includes/logging/LogPager.php @@ -53,6 +53,12 @@ class LogPager extends ReverseChronologicalPager { /** @var bool */ private $actionRestrictionsEnforced = false; + /** @var array */ + private $mConds; + + /** @var string */ + private $mTagFilter; + /** @var LogEventsList */ public $mLogEventsList; @@ -80,12 +86,13 @@ class LogPager extends ReverseChronologicalPager { $this->mLogEventsList = $list; $this->limitType( $types ); // also excludes hidden types + $this->limitLogId( $logId ); + $this->limitFilterTypes(); $this->limitPerformer( $performer ); $this->limitTitle( $title, $pattern ); $this->limitAction( $action ); $this->getDateCond( $year, $month, $day ); $this->mTagFilter = $tagFilter; - $this->limitLogId( $logId ); $this->mDb = wfGetDB( DB_REPLICA, 'logpager' ); } @@ -101,7 +108,18 @@ class LogPager extends ReverseChronologicalPager { return $query; } - // Call ONLY after calling $this->limitType() already! + private function limitFilterTypes() { + if ( $this->hasEqualsClause( 'log_id' ) ) { // T220834 + return; + } + $filterTypes = $this->getFilterParams(); + foreach ( $filterTypes as $type => $hide ) { + if ( $hide ) { + $this->mConds[] = 'log_type != ' . $this->mDb->addQuotes( $type ); + } + } + } + public function getFilterParams() { global $wgFilterLogTypes; $filters = []; @@ -121,9 +139,6 @@ class LogPager extends ReverseChronologicalPager { } $filters[$type] = $hide; - if ( $hide ) { - $this->mConds[] = 'log_type != ' . $this->mDb->addQuotes( $type ); - } } return $filters; @@ -346,6 +361,11 @@ class LogPager extends ReverseChronologicalPager { if ( !$this->mTagFilter && !array_key_exists( 'ls_field', $this->mConds ) ) { $options[] = 'STRAIGHT_JOIN'; } + if ( $this->performer !== '' ) { + // T223151: MariaDB's optimizer, at least 10.1, likes to choose a wildly bad plan for + // some reason for this code path. Tell it not to use the wrong index it wants to pick. + $options['IGNORE INDEX'] = [ 'logging' => [ 'times' ] ]; + } $info = [ 'tables' => $tables,