* (bug 26733) Wrap initial table creation in transaction
authorSam Reed <reedy@users.mediawiki.org>
Fri, 14 Jan 2011 20:43:14 +0000 (20:43 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Fri, 14 Jan 2011 20:43:14 +0000 (20:43 +0000)
RELEASE-NOTES
includes/installer/DatabaseInstaller.php

index df87557..a41ec1e 100644 (file)
@@ -79,6 +79,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   tab on the mainpage of a wiki.
 * (bug 10158) Do not mention allowing others to contact you when the feature
   is disabled ($wgEnableUserEmail=false)
+* (bug 26733) Wrap initial table creation in transaction
 
 === API changes in 1.18 ===
 * (bug 26339) Throw warning when truncating an overlarge API result
index 68b5a7b..51986ca 100644 (file)
@@ -130,10 +130,15 @@ abstract class DatabaseInstaller {
                }
 
                $this->db->setFlag( DBO_DDLMODE ); // For Oracle's handling of schema files
+               $this->db->begin( __METHOD__ );
+
                $error = $this->db->sourceFile( $this->db->getSchema() );
                if( $error !== true ) {
                        $this->db->reportQueryError( $error, 0, '', __METHOD__ );
+                       $this->db->rollback( __METHOD__ );
                        $status->fatal( 'config-install-tables-failed', $error );
+               } else {
+                       $this->db->commit( __METHOD__ );
                }
                return $status;
        }