Fix table locking in WikiPage::doDeleteArticleReal
authorGergő Tisza <tgr.huwiki@gmail.com>
Thu, 28 Jun 2018 16:33:50 +0000 (18:33 +0200)
committerGergő Tisza <tgr.huwiki@gmail.com>
Thu, 28 Jun 2018 16:33:50 +0000 (18:33 +0200)
This reverts a recent change that caused the table array and the
join array to have mismatching keys, so that the select was a
cartesian product of page and revision_comment_temp (ie. any
page deletion locked the whole revision_comment_temp table).

Bug: T198350
Change-Id: Ifb6f0409d4f210d3ecb1da03f59aaba7e229e89e

includes/page/WikiPage.php

index b970820..18ecff4 100644 (file)
@@ -2527,17 +2527,9 @@ class WikiPage implements Page, IDBAccessObject {
                // 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.
-               $tablesFlat = [];
-               array_walk_recursive(
-                       $revQuery['tables'],
-                       function ( $a ) use ( &$tablesFlat ) {
-                               $tablesFlat[] = $a;
-                       }
-               );
-
                $res = $dbw->select(
                        array_intersect(
-                               $tablesFlat,
+                               $revQuery['tables'],
                                [ 'revision', 'revision_comment_temp', 'revision_actor_temp' ]
                        ),
                        '1',