Index: trunk/extensions/ShortUrl/populateShortUrlTable.php |
— | — | @@ -29,15 +29,15 @@ |
30 | 30 | |
31 | 31 | $last_processed_id = 0; |
32 | 32 | |
33 | | - $insertBuffer = array(); |
34 | 33 | |
35 | 34 | while( true ) { |
| 35 | + $insertBuffer = array(); |
36 | 36 | $res = $dbr->select( |
37 | 37 | 'page', |
38 | 38 | array( 'page_id', 'page_namespace', 'page_title' ), |
39 | | - array( "page_id > " . $last_processed_id ), |
| 39 | + array( 'page_id > ' . $last_processed_id ), |
40 | 40 | __METHOD__, |
41 | | - array( 'LIMIT' => 100 ) |
| 41 | + array( 'LIMIT' => 100, 'ORDER BY' => 'page_id' ) |
42 | 42 | ); |
43 | 43 | if( $res->numRows() == 0 ) { |
44 | 44 | break; |
— | — | @@ -50,14 +50,12 @@ |
51 | 51 | 'su_namespace' => $row->page_namespace, |
52 | 52 | 'su_title' => $row->page_title |
53 | 53 | ); |
54 | | - $this->output( $insertBuffer ); |
55 | | - array_push( $insertBuffer, $rowData ); |
| 54 | + $insertBuffer[] = $rowData; |
56 | 55 | |
57 | 56 | $last_processed_id = $row->page_id; |
58 | 57 | } |
59 | 58 | |
60 | 59 | $this->insertRows( $insertBuffer ); |
61 | | - $insertBuffer = array(); |
62 | 60 | wfWaitForSlaves(); // 'Kill' lag |
63 | 61 | $this->output( $rowCount . " titles done\n" ); |
64 | 62 | } |