r86595 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86594‎ | r86595 | r86596 >
Date:05:43, 21 April 2011
Author:maxsem
Status:ok
Tags:
Comment:
Fixed SearchMySQL broken by r80856
Modified paths:
  • /trunk/phase3/includes/search/SearchMySQL.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/search/SearchMySQL.php
@@ -290,14 +290,18 @@
291291 function getCountQuery( $filteredTerm, $fulltext ) {
292292 $match = $this->parseQuery( $filteredTerm, $fulltext );
293293
 294+ $redir = $this->queryRedirect();
 295+ $namespaces = $this->queryNamespaces();
 296+ $conditions = array( 'page_id=si_page', $match );
 297+ if ( $redir !== '' ) {
 298+ $conditions[] = $redir;
 299+ }
 300+ if ( $namespaces !== '' ) {
 301+ $conditions[] = $namespaces;
 302+ }
294303 return $this->db->selectSQLText( array( 'page', 'searchindex' ),
295304 'COUNT(*) AS c',
296 - array(
297 - 'page_id=si_page',
298 - $match,
299 - $this->queryRedirect(),
300 - $this->queryNamespaces()
301 - ),
 305+ $conditions,
302306 __METHOD__
303307 );
304308 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80856Start another attack on raw sql queriesreedy13:59, 24 January 2011

Status & tagging log