Unbreak the DB updater by removing transaction from doUpdates()
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 10 Jul 2016 14:10:11 +0000 (07:10 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 10 Jul 2016 23:28:42 +0000 (23:28 +0000)
Each update should manage its own transactions, which is necessary
when batching is needed. Previously, maintenance updates would try
to nest begin() and an exception would halt update.php.

Bug: T89363
Change-Id: Iaadf847dcef46654e25f89680072dccd4cb5998e

includes/installer/DatabaseUpdater.php

index 6a20abc..e57e170 100644 (file)
@@ -409,7 +409,6 @@ abstract class DatabaseUpdater {
        public function doUpdates( $what = [ 'core', 'extensions', 'stats' ] ) {
                global $wgVersion;
 
-               $this->db->begin( __METHOD__ );
                $what = array_flip( $what );
                $this->skipSchema = isset( $what['noschema'] ) || $this->fileHandle !== null;
                if ( isset( $what['core'] ) ) {
@@ -431,8 +430,6 @@ abstract class DatabaseUpdater {
                        $this->writeSchemaUpdateFile();
                        $this->setAppliedUpdates( "$wgVersion-schema", $this->updatesSkipped );
                }
-
-               $this->db->commit( __METHOD__ );
        }
 
        /**