protected function doSha1LegacyUpdates() {
$count = 0;
$db = $this->getDB( DB_MASTER );
- $res = $db->select( 'archive', '*', array( 'ar_rev_id IS NULL' ), __METHOD__ );
+ $res = $db->select( 'archive', '*',
+ array( 'ar_rev_id IS NULL', 'ar_sha1' => '' ), __METHOD__ );
$updateSize = 0;
$db->begin( __METHOD__ );
*/
protected function upgradeLegacyArchiveRow( $row ) {
$db = $this->getDB( DB_MASTER );
- $rev = Revision::newFromArchiveRow( $row );
+ try {
+ $rev = Revision::newFromArchiveRow( $row );
+ } catch ( MWException $e ) {
+ return false; // bug 22624?
+ }
$text = $rev->getRawText();
if ( !is_string( $text ) ) {
# This should not happen, but sometimes does (bug 20757)