https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112443

Revision: 112443
Author:   ialex
Date:     2012-02-26 17:19:11 +0000 (Sun, 26 Feb 2012)
Log Message:
-----------
Pass __METHOD__ to DatabaseBase::begin(), DatabaseBase::commit() and 
DatabaseBase::rollback()

Modified Paths:
--------------
    trunk/phase3/includes/ExternalStoreDB.php
    trunk/phase3/includes/filerepo/backend/lockmanager/DBLockManager.php
    trunk/phase3/includes/installer/DatabaseInstaller.php
    trunk/phase3/includes/installer/MysqlInstaller.php
    trunk/phase3/includes/objectcache/SqlBagOStuff.php
    trunk/phase3/includes/revisiondelete/RevisionDeleteAbstracts.php

Modified: trunk/phase3/includes/ExternalStoreDB.php
===================================================================
--- trunk/phase3/includes/ExternalStoreDB.php   2012-02-26 16:52:37 UTC (rev 
112442)
+++ trunk/phase3/includes/ExternalStoreDB.php   2012-02-26 17:19:11 UTC (rev 
112443)
@@ -158,7 +158,7 @@
                        throw new MWException( __METHOD__.': no insert ID' );
                }
                if ( $dbw->getFlag( DBO_TRX ) ) {
-                       $dbw->commit();
+                       $dbw->commit( __METHOD__ );
                }
                return "DB://$cluster/$id";
        }

Modified: trunk/phase3/includes/filerepo/backend/lockmanager/DBLockManager.php
===================================================================
--- trunk/phase3/includes/filerepo/backend/lockmanager/DBLockManager.php        
2012-02-26 16:52:37 UTC (rev 112442)
+++ trunk/phase3/includes/filerepo/backend/lockmanager/DBLockManager.php        
2012-02-26 17:19:11 UTC (rev 112443)
@@ -276,7 +276,7 @@
                        $this->initConnection( $lockDb, $this->conns[$lockDb] );
                }
                if ( !$this->conns[$lockDb]->trxLevel() ) {
-                       $this->conns[$lockDb]->begin(); // start transaction
+                       $this->conns[$lockDb]->begin( __METHOD__ ); // start 
transaction
                }
                return $this->conns[$lockDb];
        }
@@ -302,7 +302,7 @@
                foreach ( $this->conns as $lockDb => $db ) {
                        if ( $db->trxLevel() ) { // in transaction
                                try {
-                                       $db->rollback(); // finish transaction 
and kill any rows
+                                       $db->rollback( __METHOD__ ); // finish 
transaction and kill any rows
                                } catch ( DBError $e ) {
                                        $status->fatal( 
'lockmanager-fail-db-release', $lockDb );
                                }
@@ -391,7 +391,7 @@
                foreach ( $this->conns as $lockDb => $db ) {
                        if ( $db->trxLevel() ) { // in transaction
                                try {
-                                       $db->rollback(); // finish transaction 
and kill any rows
+                                       $db->rollback( __METHOD__ ); // finish 
transaction and kill any rows
                                } catch ( DBError $e ) {
                                        // oh well
                                }

Modified: trunk/phase3/includes/installer/DatabaseInstaller.php
===================================================================
--- trunk/phase3/includes/installer/DatabaseInstaller.php       2012-02-26 
16:52:37 UTC (rev 112442)
+++ trunk/phase3/includes/installer/DatabaseInstaller.php       2012-02-26 
17:19:11 UTC (rev 112443)
@@ -141,7 +141,7 @@
                        $this->db = $status->value;
                        // Enable autocommit
                        $this->db->clearFlag( DBO_TRX );
-                       $this->db->commit();
+                       $this->db->commit( __METHOD__ );
                }
                return $status;
        }

Modified: trunk/phase3/includes/installer/MysqlInstaller.php
===================================================================
--- trunk/phase3/includes/installer/MysqlInstaller.php  2012-02-26 16:52:37 UTC 
(rev 112442)
+++ trunk/phase3/includes/installer/MysqlInstaller.php  2012-02-26 17:19:11 UTC 
(rev 112443)
@@ -521,14 +521,14 @@
                                        } catch( DBQueryError $dqe ) {
                                                if( $this->db->lastErrno() == 
1396 /* ER_CANNOT_USER */ ) {
                                                        // User (probably) 
already exists
-                                                       $this->db->rollback();
+                                                       $this->db->rollback( 
__METHOD__ );
                                                        $status->warning( 
'config-install-user-alreadyexists', $dbUser );
                                                        $grantableNames[] = 
$fullName;
                                                        break;
                                                } else {
                                                        // If we couldn't 
create for some bizzare reason and the
                                                        // user probably 
doesn't exist, skip the grant
-                                                       $this->db->rollback();
+                                                       $this->db->rollback( 
__METHOD__ );
                                                        $status->warning( 
'config-install-user-create-failed', $dbUser, $dqe->getText() );
                                                }
                                        }

Modified: trunk/phase3/includes/objectcache/SqlBagOStuff.php
===================================================================
--- trunk/phase3/includes/objectcache/SqlBagOStuff.php  2012-02-26 16:52:37 UTC 
(rev 112442)
+++ trunk/phase3/includes/objectcache/SqlBagOStuff.php  2012-02-26 17:19:11 UTC 
(rev 112443)
@@ -447,7 +447,7 @@
                }
 
                try {
-                       $db->rollback();
+                       $db->rollback( __METHOD__ );
                } catch ( DBQueryError $e ) {
                }
 

Modified: trunk/phase3/includes/revisiondelete/RevisionDeleteAbstracts.php
===================================================================
--- trunk/phase3/includes/revisiondelete/RevisionDeleteAbstracts.php    
2012-02-26 16:52:37 UTC (rev 112442)
+++ trunk/phase3/includes/revisiondelete/RevisionDeleteAbstracts.php    
2012-02-26 17:19:11 UTC (rev 112443)
@@ -111,7 +111,7 @@
 
                if ( $status->successCount == 0 ) {
                        $status->ok = false;
-                       $dbw->rollback();
+                       $dbw->rollback( __METHOD__ );
                        return $status;
                }
 
@@ -122,7 +122,7 @@
                $status->merge( $this->doPreCommitUpdates() );
                if ( !$status->isOK() ) {
                        // Fatal error, such as no configured archive directory
-                       $dbw->rollback();
+                       $dbw->rollback( __METHOD__ );
                        return $status;
                }
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to