From: jenkins-bot Date: Wed, 11 Jul 2018 19:52:31 +0000 (+0000) Subject: Merge "rdbms: add IDatabase::lockForUpdate() convenience method" X-Git-Tag: 1.34.0-rc.0~4809 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=216865344b108082f9500b5eb8cd5efeaa7df72f;p=lhc%2Fweb%2Fwiklou.git Merge "rdbms: add IDatabase::lockForUpdate() convenience method" --- 216865344b108082f9500b5eb8cd5efeaa7df72f diff --cc includes/page/WikiPage.php index 0b28074205,5608791620..f34e894d72 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@@ -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'],