Merge "Avoid profiler spam for numeric IN() clauses for each possible number of items"
[lhc/web/wiklou.git] / includes / db / Database.php
index 0082103..27e6dad 100644 (file)
@@ -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;