r87998 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87997‎ | r87998 | r87999 >
Date:15:56, 13 May 2011
Author:hashar
Status:reverted
Tags:
Comment:
bug 2429 fix up index by using IN / NOT IN instead of (!= and !=)

Tested (EXPLAIN <query>) against the english wikipedia database.

Follow up:
- r83110 : original ns association implementation
- r87992 : abstraction support for 'NOT IN'

(note: breaks some existing PHPUnit tests)
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRecentchanges.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRecentchanges.php
@@ -316,25 +316,24 @@
317317
318318 # Namespace filtering
319319 if( $opts['namespace'] !== '' ) {
320 - $selectedNS = $dbr->addQuotes( $opts['namespace'] );
321 - $operator = $opts['invert'] ? '!=' : '=';
322 - $boolean = $opts['invert'] ? 'AND' : 'OR';
 320+ $namespaces[] = $opts['namespace'];
323321
324 - # namespace association (bug 2429)
325 - if( !$opts['associated'] ) {
326 - $condition = "rc_namespace $operator $selectedNS";
327 - } else {
328 - # Also add the associated namespace
329 - $associatedNS = $dbr->addQuotes(
330 - MWNamespace::getAssociated( $opts['namespace'] )
331 - );
332 - $condition = "(rc_namespace $operator $selectedNS "
333 - . $boolean
334 - . " rc_namespace $operator $associatedNS)";
 322+ $inversionSuffix = $opts['invert'] ? '!' : '';
 323+
 324+ if( $opts['associated'] ) {
 325+ # namespace association (bug 2429)
 326+ $namespaces[] = MWNamespace::getAssociated( $opts['namespace'] );
335327 }
336328
 329+ $condition = $dbr->makeList(
 330+ array( 'rc_namespace' . $inversionSuffix
 331+ => $namespaces ),
 332+ LIST_AND
 333+ );
 334+
337335 $conds[] = $condition;
338336 }
 337+
339338 return $conds;
340339 }
341340

Follow-up revisions

RevisionCommit summaryAuthorDate
r92328REL1_18 MFT r79056, r80612, r81499, r87627, r87628, r87630, r87998, r88134, r...reedy22:46, 15 July 2011
r96930Revert r87992 and followups r87998, r89028 (Support abstraction for 'NOT IN' ...demon00:19, 13 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r83110Bug 2429 allow selection of associated namespace in recent changes...hashar20:40, 2 March 2011
r87992Support abstraction for 'NOT IN' SQL structure...hashar15:39, 13 May 2011

Status & tagging log