From: Aaron Schulz Date: Thu, 20 Nov 2014 08:22:42 +0000 (-0800) Subject: Fixed regression that made log queries happen in spite of the bloom filter X-Git-Tag: 1.31.0-rc.0~13233 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=09d941379540c94e9a0057056ab1396add33f878;p=lhc%2Fweb%2Fwiklou.git Fixed regression that made log queries happen in spite of the bloom filter Change-Id: I50f280a1db30cb1f9901a55a8a9558ebb2a9dffd --- 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; } /**