Index: trunk/phase3/includes/specials/SpecialRecentchanges.php |
— | — | @@ -319,31 +319,35 @@ |
320 | 320 | $dbr = wfGetDB( DB_SLAVE ); |
321 | 321 | $limit = $opts['limit']; |
322 | 322 | $namespace = $opts['namespace']; |
323 | | - $select = '*'; |
324 | 323 | $invert = $opts['invert']; |
325 | 324 | |
| 325 | + $fields = array( $dbr->tableName( 'recentchanges' ) . '.*' ); // all rc columns |
326 | 326 | // JOIN on watchlist for users |
327 | | - if( $uid ) { |
| 327 | + if ( $uid ) { |
328 | 328 | $tables[] = 'watchlist'; |
| 329 | + $fields[] = 'wl_user'; |
| 330 | + $fields[] = 'wl_notificationtimestamp'; |
329 | 331 | $join_conds['watchlist'] = array('LEFT JOIN', |
330 | 332 | "wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace"); |
331 | 333 | } |
332 | | - if ($this->getUser()->isAllowed("rollback")) { |
| 334 | + if ( $this->getUser()->isAllowed( 'rollback' ) ) { |
333 | 335 | $tables[] = 'page'; |
| 336 | + $fields[] = 'page_latest'; |
334 | 337 | $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id'); |
335 | 338 | } |
336 | 339 | if ( !$this->including() ) { |
337 | 340 | // Tag stuff. |
338 | 341 | // Doesn't work when transcluding. See bug 23293 |
339 | | - $fields = array(); |
340 | | - // Fields are * in this case, so let the function modify an empty array to keep it happy. |
341 | 342 | ChangeTags::modifyDisplayQuery( |
342 | 343 | $tables, $fields, $conds, $join_conds, $query_options, $opts['tagfilter'] |
343 | 344 | ); |
344 | 345 | } |
345 | 346 | |
346 | | - if ( !wfRunHooks( 'SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$select ) ) ) |
| 347 | + if ( !wfRunHooks( 'SpecialRecentChangesQuery', |
| 348 | + array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ) ) ) |
| 349 | + { |
347 | 350 | return false; |
| 351 | + } |
348 | 352 | |
349 | 353 | // Don't use the new_namespace_time timestamp index if: |
350 | 354 | // (a) "All namespaces" selected |
— | — | @@ -355,21 +359,21 @@ |
356 | 360 | || $opts['tagfilter'] != '' |
357 | 361 | || !$dbr->unionSupportsOrderAndLimit() ) |
358 | 362 | { |
359 | | - $res = $dbr->select( $tables, '*', $conds, __METHOD__, |
| 363 | + $res = $dbr->select( $tables, $fields, $conds, __METHOD__, |
360 | 364 | array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit ) + |
361 | 365 | $query_options, |
362 | 366 | $join_conds ); |
363 | 367 | // We have a new_namespace_time index! UNION over new=(0,1) and sort result set! |
364 | 368 | } else { |
365 | 369 | // New pages |
366 | | - $sqlNew = $dbr->selectSQLText( $tables, $select, |
| 370 | + $sqlNew = $dbr->selectSQLText( $tables, $fields, |
367 | 371 | array( 'rc_new' => 1 ) + $conds, |
368 | 372 | __METHOD__, |
369 | 373 | array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit, |
370 | 374 | 'USE INDEX' => array('recentchanges' => 'rc_timestamp') ), |
371 | 375 | $join_conds ); |
372 | 376 | // Old pages |
373 | | - $sqlOld = $dbr->selectSQLText( $tables, '*', |
| 377 | + $sqlOld = $dbr->selectSQLText( $tables, $fields, |
374 | 378 | array( 'rc_new' => 0 ) + $conds, |
375 | 379 | __METHOD__, |
376 | 380 | array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit, |