From d94a5c89f999ad5bcfcaa029991dbb76e8ecab58 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 23 May 2012 12:28:09 -0700 Subject: [PATCH] Skip legacy archives rows that already have the sha1 filled. Change-Id: I070413a736211017022c7ae36a9efab3aa0e1fe1 --- maintenance/populateRevisionSha1.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/maintenance/populateRevisionSha1.php b/maintenance/populateRevisionSha1.php index 6125fc0831..a90b5406b6 100644 --- a/maintenance/populateRevisionSha1.php +++ b/maintenance/populateRevisionSha1.php @@ -102,7 +102,8 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { 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__ ); @@ -145,7 +146,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { $db->update( $table, array( "{$prefix}_sha1" => Revision::base36Sha1( $text ) ), array( $idCol => $row->$idCol ), - __METHOD__ + __METHOD__ ); return true; } @@ -174,7 +175,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { 'ar_timestamp' => $row->ar_timestamp, 'ar_len' => $row->ar_len // extra sanity ), - __METHOD__ + __METHOD__ ); return true; } -- 2.20.1