Merge "Reorder SpecialRecentChanges::webOutput"
[lhc/web/wiklou.git] / includes / db / Database.php
index 0b2cc98..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;
 
@@ -1605,7 +1605,8 @@ abstract class DatabaseBase implements IDatabase, DatabaseType {
                $sql = preg_replace( '/\s+/', ' ', $sql );
 
                # All numbers => N
-               $sql = preg_replace( '/-?[0-9]+/s', 'N', $sql );
+               $sql = preg_replace( '/-?\d+(,-?\d+)+/s', 'N,...,N', $sql );
+               $sql = preg_replace( '/-?\d+/s', 'N', $sql );
 
                return $sql;
        }