Merge "rdbms: add IDatabase::lockForUpdate() convenience method"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 11 Jul 2018 19:52:31 +0000 (19:52 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 11 Jul 2018 19:52:31 +0000 (19:52 +0000)
1  2 
includes/Category.php
includes/filerepo/file/LocalFile.php
includes/libs/rdbms/database/DBConnRef.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/database/IDatabase.php
includes/page/WikiPage.php

Simple merge
Simple merge
@@@ -2542,29 -2532,13 +2542,25 @@@ class WikiPage implements Page, IDBAcce
                                $revQuery['tables'],
                                [ 'revision', 'revision_comment_temp', 'revision_actor_temp' ]
                        ),
-                       '1',
                        [ 'rev_page' => $id ],
                        __METHOD__,
-                       'FOR UPDATE',
+                       [],
                        $revQuery['joins']
                );
-               foreach ( $res as $row ) {
-                       // Fetch all rows in case the DB needs that to properly lock them.
-               }
  
 -              // Get all of the page revisions
 +              // If SCHEMA_COMPAT_WRITE_OLD is set, also select all extra fields we still write,
 +              // so we can copy it to the archive table.
 +              // We know the fields exist, otherwise SCHEMA_COMPAT_WRITE_OLD could not function.
 +              if ( $wgMultiContentRevisionSchemaMigrationStage & SCHEMA_COMPAT_WRITE_OLD ) {
 +                      $revQuery['fields'][] = 'rev_text_id';
 +
 +                      if ( $wgContentHandlerUseDB ) {
 +                              $revQuery['fields'][] = 'rev_content_model';
 +                              $revQuery['fields'][] = 'rev_content_format';
 +                      }
 +              }
 +
 +                      // Get all of the page revisions
                $res = $dbw->select(
                        $revQuery['tables'],
                        $revQuery['fields'],