Index: trunk/phase3/maintenance/populateRevisionSha1.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | public function __construct() { |
28 | 28 | parent::__construct(); |
29 | 29 | $this->mDescription = "Populates the rev_sha1 and ar_sha1 fields"; |
30 | | - $this->setBatchSize( 150 ); |
| 30 | + $this->setBatchSize( 200 ); |
31 | 31 | } |
32 | 32 | |
33 | 33 | public function execute() { |
— | — | @@ -78,10 +78,16 @@ |
79 | 79 | } else { |
80 | 80 | $rev = new Revision( $row ); |
81 | 81 | } |
82 | | - $db->update( $table, |
83 | | - array( "{$prefix}_sha1" => Revision::base36Sha1( $rev->getRawText() ) ), |
84 | | - array( $idCol => $row->$idCol ), |
85 | | - __METHOD__ ); |
| 82 | + $text = $rev->getRawText(); |
| 83 | + if ( !is_string( $text ) ) { |
| 84 | + # This should not happen, but sometimes does (bug 20757) |
| 85 | + $this->output( "Text of revision {$row->$idCol} unavailable!\n" ); |
| 86 | + } else { |
| 87 | + $db->update( $table, |
| 88 | + array( "{$prefix}_sha1" => Revision::base36Sha1( $text ) ), |
| 89 | + array( $idCol => $row->$idCol ), |
| 90 | + __METHOD__ ); |
| 91 | + } |
86 | 92 | } |
87 | 93 | $db->commit(); |
88 | 94 | |