r37154 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37153‎ | r37154 | r37155 >
Date:08:38, 6 July 2008
Author:nicdumz
Status:old
Tags:
Comment:
Tweaks to use the good index :)
Modified paths:
  • /branches/category-redirects/includes/CategoryPage.php (modified) (history)

Diff [purge]

Index: branches/category-redirects/includes/CategoryPage.php
@@ -223,18 +223,18 @@
224224 $this->flip = false;
225225 }
226226
227 - # When displaying a category redirect, show only inline inclusions
228 - $linkedFrom = $this->cat->getRedir() ? 'cl_inline' : 'cl_target' ;
 227+ # When displaying a category redirect (with redirect=no) , show only inline inclusions
 228+ $linkedFrom = $this->cat->getRedir() ? 'inline' : 'target' ;
229229
230230 $res = $dbr->select(
231231 array( 'page', 'categorylinks', 'category' ),
232232 array( 'page_title', 'page_namespace', 'page_len', 'page_is_redirect', 'cl_sortkey',
233233 'cat_id', 'cat_redir', 'cat_title', 'cat_subcats', 'cat_pages', 'cat_files' ),
234234 array( $pageCondition,
235 - $linkedFrom => $this->cat->getID() ),
 235+ 'cl_' . $linkedFrom => $this->cat->getID() ),
236236 __METHOD__,
237237 array( 'ORDER BY' => $this->flip ? 'cl_sortkey DESC' : 'cl_sortkey',
238 - 'USE INDEX' => array( 'categorylinks' => 'cl_sortkey_target' ),
 238+ 'USE INDEX' => array( 'categorylinks' => 'cl_sortkey_' . $linkedFrom ),
239239 'LIMIT' => $this->limit + 1 ),
240240 array( 'categorylinks' => array( 'INNER JOIN', 'cl_from = page_id' ),
241241 'category' => array( 'LEFT JOIN', 'cat_title = page_title AND page_namespace = ' . NS_CATEGORY ) ) );

Status & tagging log