Index: trunk/phase3/maintenance/dumpTextPass.php |
— | — | @@ -188,8 +188,15 @@ |
189 | 189 | // Blank entries may indicate that the prior dump was broken. |
190 | 190 | // To be safe, reload it. |
191 | 191 | } else { |
192 | | - $this->prefetchCount++; |
193 | | - return $text; |
| 192 | + $dbr = wfGetDB( DB_SLAVE ); |
| 193 | + $revID = intval($this->thisRev); |
| 194 | + $revLength = $dbr->selectField( 'revision', 'rev_len', array('rev_id' => $revID ) ); |
| 195 | + // if length of rev text in file doesn't match length in db, we reload |
| 196 | + // this avoids carrying forward broken data from previous xml dumps |
| 197 | + if( strlen($text) == $revLength ) { |
| 198 | + $this->prefetchCount++; |
| 199 | + return $text; |
| 200 | + } |
194 | 201 | } |
195 | 202 | } |
196 | 203 | return $this->doGetText( $id ); |