From: Aaron Schulz Date: Thu, 22 Aug 2013 21:44:30 +0000 (-0700) Subject: Further fix to profiling order for DBPerformance log X-Git-Tag: 1.31.0-rc.0~18903^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=8b47c6b901ead58b463ed07c765288172e7c9b90;p=lhc%2Fweb%2Fwiklou.git Further fix to profiling order for DBPerformance log * Make sure transactionWritingIn() gets called before the profileIn() so the first write query shows up Change-Id: Ife504651f6fe33f1360e817bcb05afc02f4075a5 --- diff --git a/includes/db/Database.php b/includes/db/Database.php index 0b2cc986b7..8e1f93fa68 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -923,6 +923,12 @@ abstract class DatabaseBase implements IDatabase, DatabaseType { } } + # Keep track of whether the transaction has write queries pending + if ( $this->mTrxLevel && !$this->mTrxDoneWrites && $this->isWriteQuery( $sql ) ) { + $this->mTrxDoneWrites = true; + Profiler::instance()->transactionWritingIn( $this->mServer, $this->mDBname ); + } + $isMaster = !is_null( $this->getLBInfo( 'master' ) ); if ( !Profiler::instance()->isStub() ) { # generalizeSQL will probably cut down the query to reasonable @@ -938,12 +944,6 @@ abstract class DatabaseBase implements IDatabase, DatabaseType { wfProfileIn( $queryProf ); } - # Keep track of whether the transaction has write queries pending - if ( $this->mTrxLevel && !$this->mTrxDoneWrites && $this->isWriteQuery( $sql ) ) { - $this->mTrxDoneWrites = true; - Profiler::instance()->transactionWritingIn( $this->mServer, $this->mDBname ); - } - if ( $this->debug() ) { static $cnt = 0;