Make LocalisationCache a service
[lhc/web/wiklou.git] / maintenance / populateRevisionLength.php
index 8895c9f..1e73540 100644 (file)
@@ -21,6 +21,9 @@
  * @ingroup Maintenance
  */
 
+use MediaWiki\Revision\RevisionRecord;
+use Wikimedia\Rdbms\IDatabase;
+
 require_once __DIR__ . '/Maintenance.php';
 
 /**
@@ -97,7 +100,13 @@ class PopulateRevisionLength extends LoggedUpdateMaintenance {
                                [
                                        "$idCol >= $blockStart",
                                        "$idCol <= $blockEnd",
-                                       "{$prefix}_len IS NULL"
+                                       $dbr->makeList( [
+                                               "{$prefix}_len IS NULL",
+                                               $dbr->makeList( [
+                                                       "{$prefix}_len = 0",
+                                                       "{$prefix}_sha1 != " . $dbr->addQuotes( 'phoiac9h4m842xq45sp7s6u21eteeq1' ), // sha1( "" )
+                                               ], IDatabase::LIST_AND )
+                                       ], IDatabase::LIST_OR )
                                ],
                                __METHOD__,
                                [],
@@ -136,7 +145,7 @@ class PopulateRevisionLength extends LoggedUpdateMaintenance {
                        ? Revision::newFromArchiveRow( $row )
                        : new Revision( $row );
 
-               $content = $rev->getContent();
+               $content = $rev->getContent( RevisionRecord::RAW );
                if ( !$content ) {
                        # This should not happen, but sometimes does (T22757)
                        $id = $row->$idCol;