Index: trunk/phase3/maintenance/cleanupTable.inc |
— | — | @@ -87,6 +87,10 @@ |
88 | 88 | |
89 | 89 | protected function runTable( $table, $where, $callback ) { |
90 | 90 | $dbw = wfGetDB( DB_MASTER ); |
| 91 | + |
| 92 | + // Unbuffered queries, avoids OOM |
| 93 | + $dbw->bufferResults( false ); |
| 94 | + |
91 | 95 | $count = $dbw->selectField( $table, 'count(*)', '', __METHOD__ ); |
92 | 96 | $this->init( $count, $table ); |
93 | 97 | $this->output( "Processing $table..." ); |
— | — | @@ -98,8 +102,12 @@ |
99 | 103 | foreach( $result as $row ) { |
100 | 104 | call_user_func( $callback, $row ); |
101 | 105 | } |
| 106 | + |
102 | 107 | $this->output( "Finished $table... $this->updated of $this->processed rows updated\n" ); |
| 108 | + |
103 | 109 | $result->free(); |
| 110 | + |
| 111 | + $dbw->bufferResults( true ); |
104 | 112 | } |
105 | 113 | |
106 | 114 | protected function hexChar( $matches ) { |