From 8b47c6b901ead58b463ed07c765288172e7c9b90 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 22 Aug 2013 14:44:30 -0700 Subject: [PATCH] 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 --- includes/db/Database.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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; -- 2.20.1