From 09d941379540c94e9a0057056ab1396add33f878 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 20 Nov 2014 00:22:42 -0800 Subject: [PATCH] Fixed regression that made log queries happen in spite of the bloom filter Change-Id: I50f280a1db30cb1f9901a55a8a9558ebb2a9dffd --- includes/logging/LogEventsList.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index c7f5e5ab59..e03cf1cd94 100644 --- a/includes/logging/LogEventsList.php +++ b/includes/logging/LogEventsList.php @@ -542,22 +542,28 @@ class LogEventsList extends ContextSource { $pager->mLimit = $lim; } - $logBody = null; + $knownEmptyResult = false; // Check if we can avoid the DB query all together if ( $page !== '' && !$param['useMaster'] ) { $title = ( $page instanceof Title ) ? $page : Title::newFromText( $page ); if ( $title ) { $member = $title->getNamespace() . ':' . $title->getDBkey(); if ( !BloomCache::get( 'main' )->check( wfWikiId(), 'TitleHasLogs', $member ) ) { - $logBody = ''; + $knownEmptyResult = true; } } else { - $logBody = ''; + $knownEmptyResult = true; } } // Fetch the log rows and build the HTML if needed - $logBody = ( $logBody === null ) ? $pager->getBody() : $logBody; + if ( $knownEmptyResult ) { + $logBody = ''; + $numRows = 0; + } else { + $logBody = $pager->getBody(); + $numRows = $pager->getNumRows(); + } $s = ''; @@ -588,7 +594,7 @@ class LogEventsList extends ContextSource { $context->msg( 'logempty' )->parse() ); } - if ( $pager->getNumRows() > $pager->mLimit ) { # Show "Full log" link + if ( $numRows > $pager->mLimit ) { # Show "Full log" link $urlParam = array(); if ( $page instanceof Title ) { $urlParam['page'] = $page->getPrefixedDBkey(); @@ -635,7 +641,7 @@ class LogEventsList extends ContextSource { } } - return $pager->getNumRows(); + return $numRows; } /** -- 2.20.1