From d97561461c31ad4f76d5e3242acc722443d061ca Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 25 Feb 2012 13:23:43 +0000 Subject: [PATCH] Pass __METHOD__ to DatabaseBase::begin(), DatabaseBase::commit() and DatabaseBase::rollback() --- includes/db/DatabaseIbm_db2.php | 8 ++++---- includes/db/DatabaseMysql.php | 4 ++-- includes/db/DatabaseOracle.php | 2 +- includes/db/DatabasePostgres.php | 2 +- includes/db/DatabaseSqlite.php | 4 ++-- includes/db/LoadBalancer.php | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/includes/db/DatabaseIbm_db2.php b/includes/db/DatabaseIbm_db2.php index 790a177fcb..4d9e7075cd 100644 --- a/includes/db/DatabaseIbm_db2.php +++ b/includes/db/DatabaseIbm_db2.php @@ -561,7 +561,7 @@ class DatabaseIbm_db2 extends DatabaseBase { $this->mOpened = false; if ( $this->mConn ) { if ( $this->trxLevel() > 0 ) { - $this->commit(); + $this->commit( __METHOD__ ); } return db2_close( $this->mConn ); } else { @@ -577,12 +577,12 @@ class DatabaseIbm_db2 extends DatabaseBase { public function lastError() { $connerr = db2_conn_errormsg(); if ( $connerr ) { - //$this->rollback(); + //$this->rollback( __METHOD__ ); return $connerr; } $stmterr = db2_stmt_errormsg(); if ( $stmterr ) { - //$this->rollback(); + //$this->rollback( __METHOD__ ); return $stmterr; } @@ -1084,7 +1084,7 @@ class DatabaseIbm_db2 extends DatabaseBase { $this->mAffectedRows = $numrowsinserted; } // commit either way - $this->commit(); + $this->commit( __METHOD__ ); $this->freePrepared( $stmt ); return $res; diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index b4efd56a90..23d6531c12 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -158,7 +158,7 @@ class DatabaseMysql extends DatabaseBase { $this->mOpened = false; if ( $this->mConn ) { if ( $this->trxLevel() ) { - $this->commit(); + $this->commit( __METHOD__ ); } return mysql_close( $this->mConn ); } else { @@ -558,7 +558,7 @@ class DatabaseMysql extends DatabaseBase { # Commit any open transactions if ( $this->mTrxLevel ) { - $this->commit(); + $this->commit( __METHOD__ ); } if ( !is_null( $this->mFakeSlaveLag ) ) { diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 8a35ad5bbd..32a38adae0 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -292,7 +292,7 @@ class DatabaseOracle extends DatabaseBase { $this->mOpened = false; if ( $this->mConn ) { if ( $this->mTrxLevel ) { - $this->commit(); + $this->commit( __METHOD__ ); } return oci_close( $this->mConn ); } else { diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 6a453e72a4..978bfc7c0e 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -466,7 +466,7 @@ class DatabasePostgres extends DatabaseBase { $didbegin = 0; if ( $ignore ) { if ( !$this->mTrxLevel ) { - $this->begin(); + $this->begin( __METHOD__ ); $didbegin = 1; } $olde = error_reporting( 0 ); diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php index 05568102dd..1cc82cf2bf 100644 --- a/includes/db/DatabaseSqlite.php +++ b/includes/db/DatabaseSqlite.php @@ -122,7 +122,7 @@ class DatabaseSqlite extends DatabaseBase { function close() { $this->mOpened = false; if ( is_object( $this->mConn ) ) { - if ( $this->trxLevel() ) $this->commit(); + if ( $this->trxLevel() ) $this->commit( __METHOD__ ); $this->mConn = null; } return true; @@ -636,7 +636,7 @@ class DatabaseSqlite extends DatabaseBase { function begin( $fname = '' ) { if ( $this->mTrxLevel == 1 ) { - $this->commit(); + $this->commit( __METHOD__ ); } $this->mConn->beginTransaction(); $this->mTrxLevel = 1; diff --git a/includes/db/LoadBalancer.php b/includes/db/LoadBalancer.php index 1d00f8f277..db348e81de 100644 --- a/includes/db/LoadBalancer.php +++ b/includes/db/LoadBalancer.php @@ -894,7 +894,7 @@ class LoadBalancer { foreach ( $this->mConns as $conns2 ) { foreach ( $conns2 as $conns3 ) { foreach ( $conns3 as $conn ) { - $conn->commit(); + $conn->commit( __METHOD__ ); } } } -- 2.20.1