X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=blobdiff_plain;f=includes%2Fpage%2FWikiPage.php;h=afe266bf71d7f6226f33a14cae83ac3f227723d3;hb=8bda7b9dcdfbab485f439fbf4f41da1c84f5d62e;hp=f45036c1db40fea62d78a0cb63c70735b859bbdf;hpb=815b516edb143fb1da11797bc1fc37410deb92b9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index f45036c1db..afe266bf71 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -2871,13 +2871,32 @@ class WikiPage implements Page, IDBAccessObject { // In the future, we may keep revisions and mark them with // the rev_deleted field, which is reserved for this purpose. + // Lock rows in `revision` and its temp tables, but not any others. + // Note array_intersect() preserves keys from the first arg, and we're + // assuming $revQuery has `revision` primary and isn't using subtables + // for anything we care about. + $res = $dbw->select( + array_intersect( + $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 $res = $dbw->select( $revQuery['tables'], $revQuery['fields'], [ 'rev_page' => $id ], __METHOD__, - 'FOR UPDATE', + [], $revQuery['joins'] ); @@ -3269,7 +3288,7 @@ class WikiPage implements Page, IDBAccessObject { if ( $wgUseRCPatrol ) { // Mark all reverted edits as patrolled - $set['rc_patrolled'] = 1; + $set['rc_patrolled'] = RecentChange::PRC_PATROLLED; } if ( count( $set ) ) {