* @file
*/
+use MediaWiki\MediaWikiServices;
+
/**
* @ingroup Pager
*/
# Don't show duplicate rows when using log_search
$joins['log_search'] = [ 'JOIN', 'ls_log_id=log_id' ];
+ // 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 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';
+ }
+
$info = [
'tables' => $tables,
'fields' => $fields,
$user = $this->getUser();
if ( !$user->isAllowed( 'deletedhistory' ) ) {
$this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::DELETED_ACTION ) . ' = 0';
- } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
+ } elseif ( !MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasAnyRight( $user, 'suppressrevision', 'viewsuppressed' )
+ ) {
$this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::SUPPRESSED_ACTION ) .
' != ' . LogPage::SUPPRESSED_USER;
}
$user = $this->getUser();
if ( !$user->isAllowed( 'deletedhistory' ) ) {
$this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::DELETED_USER ) . ' = 0';
- } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) {
+ } elseif ( !MediaWikiServices::getInstance()
+ ->getPermissionManager()
+ ->userHasAnyRight( $user, 'suppressrevision', 'viewsuppressed' )
+ ) {
$this->mConds[] = $this->mDb->bitAnd( 'log_deleted', LogPage::SUPPRESSED_USER ) .
' != ' . LogPage::SUPPRESSED_ACTION;
}