Index: trunk/phase3/includes/BacklinkCache.php |
— | — | @@ -53,13 +53,13 @@ |
54 | 54 | public function getLinks( $table, $startId = false, $endId = false ) { |
55 | 55 | wfProfileIn( __METHOD__ ); |
56 | 56 | |
| 57 | + $fromField = $this->getPrefix( $table ) . '_from'; |
57 | 58 | if ( $startId || $endId ) { |
58 | 59 | // Partial range, not cached |
59 | 60 | wfDebug( __METHOD__.": from DB (uncacheable range)\n" ); |
60 | 61 | $conds = $this->getConditions( $table ); |
61 | 62 | // Use the from field in the condition rather than the joined page_id, |
62 | 63 | // because databases are stupid and don't necessarily propagate indexes. |
63 | | - $fromField = $this->getPrefix( $table ) . '_from'; |
64 | 64 | if ( $startId ) { |
65 | 65 | $conds[] = "$fromField >= " . intval( $startId ); |
66 | 66 | } |
— | — | @@ -71,7 +71,10 @@ |
72 | 72 | array( 'page_namespace', 'page_title', 'page_id'), |
73 | 73 | $conds, |
74 | 74 | __METHOD__, |
75 | | - array('STRAIGHT_JOIN') ); |
| 75 | + array( |
| 76 | + 'STRAIGHT_JOIN', |
| 77 | + 'ORDER BY' => $fromField |
| 78 | + ) ); |
76 | 79 | $ta = TitleArray::newFromResult( $res ); |
77 | 80 | wfProfileOut( __METHOD__ ); |
78 | 81 | return $ta; |
— | — | @@ -84,7 +87,10 @@ |
85 | 88 | array( 'page_namespace', 'page_title', 'page_id' ), |
86 | 89 | $this->getConditions( $table ), |
87 | 90 | __METHOD__, |
88 | | - array('STRAIGHT_JOIN') ); |
| 91 | + array( |
| 92 | + 'STRAIGHT_JOIN', |
| 93 | + 'ORDER BY' => $fromField, |
| 94 | + ) ); |
89 | 95 | $this->fullResultCache[$table] = $res; |
90 | 96 | } |
91 | 97 | $ta = TitleArray::newFromResult( $this->fullResultCache[$table] ); |
— | — | @@ -225,6 +231,12 @@ |
226 | 232 | $row = $res->fetchObject(); |
227 | 233 | $end = $row->page_id - 1; |
228 | 234 | } |
| 235 | + |
| 236 | + # Sanity check order |
| 237 | + if ( $start && $end && $start > $end ) { |
| 238 | + throw new MWException( __METHOD__.': Internal error: query result out of order' ); |
| 239 | + } |
| 240 | + |
229 | 241 | $batches[] = array( $start, $end ); |
230 | 242 | } |
231 | 243 | return array( 'numRows' => $numRows, 'batches' => $batches ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -661,6 +661,8 @@ |
662 | 662 | * (bug 18762) both redirects and links get fixed one after another if |
663 | 663 | redirects-only switch is not present |
664 | 664 | * (bug 20159) thumbnails rerendered if older that $wgThumbnailEpoch |
| 665 | +* Fixed a bug which in some situations causes the job queue to grow forever, |
| 666 | + due to an infinite loop of job requeues. |
665 | 667 | |
666 | 668 | == API changes in 1.16 == |
667 | 669 | |