Index: trunk/extensions/FlaggedRevs/specialpages/PendingChanges_body.php |
— | — | @@ -341,8 +341,7 @@ |
342 | 342 | $fields[] = 'fp_quality AS quality'; |
343 | 343 | $fields[] = 'fp_pending_since AS pending_since'; |
344 | 344 | $conds[] = 'page_id = fp_page_id'; |
345 | | - # Overconstrain rev_page to force PK use |
346 | | - $conds[] = 'rev_page = page_id AND rev_id = fp_stable'; |
| 345 | + $conds[] = 'rev_id = fp_stable'; // PK |
347 | 346 | $conds[] = 'fp_pending_since IS NOT NULL'; |
348 | 347 | $useIndex = array( 'flaggedpages' => 'fp_pending_since', 'page' => 'PRIMARY' ); |
349 | 348 | # Filter by pages configured to be stable |
— | — | @@ -352,7 +351,7 @@ |
353 | 352 | $conds['fpc_override'] = 1; |
354 | 353 | } |
355 | 354 | # Filter by category |
356 | | - if ( $this->category ) { |
| 355 | + if ( $this->category != '' ) { |
357 | 356 | $tables[] = 'categorylinks'; |
358 | 357 | $conds[] = 'cl_from = fp_page_id'; |
359 | 358 | $conds['cl_to'] = $this->category; |
— | — | @@ -366,11 +365,10 @@ |
367 | 366 | $fields[] = 'fpp_quality AS quality'; |
368 | 367 | $fields[] = 'fpp_pending_since AS pending_since'; |
369 | 368 | $conds[] = 'page_id = fpp_page_id'; |
370 | | - # Overconstrain rev_page to force PK use |
371 | | - $conds[] = 'rev_page = page_id AND rev_id = fpp_rev_id'; |
| 369 | + $conds[] = 'rev_id = fpp_rev_id'; // PK |
372 | 370 | $conds[] = 'fpp_pending_since IS NOT NULL'; |
373 | | - $useIndex = array( 'flaggedpage_pending' => 'fpp_quality_pending', |
374 | | - 'page' => 'PRIMARY' ); |
| 371 | + $useIndex = array( |
| 372 | + 'flaggedpage_pending' => 'fpp_quality_pending', 'page' => 'PRIMARY' ); |
375 | 373 | # Filter by review level |
376 | 374 | $conds['fpp_quality'] = $this->level; |
377 | 375 | # Filter by pages configured to be stable |
— | — | @@ -402,8 +400,7 @@ |
403 | 401 | } |
404 | 402 | # Filter by bytes changed |
405 | 403 | if ( $this->size !== null && $this->size >= 0 ) { |
406 | | - # Get absolute difference for comparison. ABS(x-y) |
407 | | - # is broken due to mysql unsigned int design. |
| 404 | + # Note: ABS(x-y) is broken due to mysql unsigned int design. |
408 | 405 | $conds[] = 'GREATEST(page_len,rev_len)-LEAST(page_len,rev_len) <= ' . |
409 | 406 | intval( $this->size ); |
410 | 407 | } |
Index: trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php |
— | — | @@ -147,7 +147,7 @@ |
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
151 | | - * Get number of users watching a page. Max is 5. |
| 151 | + * Get number of users watching a page. |
152 | 152 | * @param Title $title |
153 | 153 | * @return int |
154 | 154 | */ |
— | — | @@ -267,15 +267,15 @@ |
268 | 268 | $conds['page_is_redirect'] = 0; |
269 | 269 | } |
270 | 270 | # Filter by category |
271 | | - if ( $this->category ) { |
| 271 | + if ( $this->category != '' ) { |
272 | 272 | $tables = array( 'categorylinks', 'page', 'flaggedpages', 'revision' ); |
273 | 273 | $fields[] = 'cl_sortkey'; |
274 | 274 | $conds['cl_to'] = $this->category; |
275 | 275 | $conds[] = 'cl_from = page_id'; |
276 | 276 | # Note: single NS always specified |
277 | | - if( $this->namespace == NS_FILE ) { |
| 277 | + if ( $this->namespace == NS_FILE ) { |
278 | 278 | $conds['cl_type'] = 'file'; |
279 | | - } elseif( $this->namespace == NS_CATEGORY ) { |
| 279 | + } elseif ( $this->namespace == NS_CATEGORY ) { |
280 | 280 | $conds['cl_type'] = 'subcat'; |
281 | 281 | } else { |
282 | 282 | $conds['cl_type'] = 'page'; |
— | — | @@ -311,7 +311,7 @@ |
312 | 312 | # the proper cache for this level. |
313 | 313 | if ( $this->level == 1 ) { |
314 | 314 | $conds['qc_type'] = 'fr_unreviewedpages_q'; |
315 | | - $conds[] = "fp_page_id IS NULL OR fp_quality < {$this->level}"; |
| 315 | + $conds[] = "fp_page_id IS NULL OR fp_quality < 1"; |
316 | 316 | } else { |
317 | 317 | $conds['qc_type'] = 'fr_unreviewedpages'; |
318 | 318 | $conds[] = 'fp_page_id IS NULL'; |
— | — | @@ -324,10 +324,18 @@ |
325 | 325 | } |
326 | 326 | $this->mIndexField = 'qc_value'; // page_id |
327 | 327 | # Filter by category |
328 | | - if ( $this->category ) { |
| 328 | + if ( $this->category != '' ) { |
329 | 329 | $tables = array( 'page', 'categorylinks', 'querycache', 'flaggedpages', 'revision' ); |
330 | 330 | $conds['cl_to'] = $this->category; |
331 | 331 | $conds[] = 'cl_from = qc_value'; // page_id |
| 332 | + # Note: single NS always specified |
| 333 | + if ( $this->namespace == NS_FILE ) { |
| 334 | + $conds['cl_type'] = 'file'; |
| 335 | + } elseif ( $this->namespace == NS_CATEGORY ) { |
| 336 | + $conds['cl_type'] = 'subcat'; |
| 337 | + } else { |
| 338 | + $conds['cl_type'] = 'page'; |
| 339 | + } |
332 | 340 | } else { |
333 | 341 | $tables = array( 'page', 'querycache', 'flaggedpages', 'revision' ); |
334 | 342 | } |