Fixed ordering of SQL debug log
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 28 Mar 2005 07:56:17 +0000 (07:56 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 28 Mar 2005 07:56:17 +0000 (07:56 +0000)
includes/Database.php

index f367cf9..7fe6ae9 100644 (file)
@@ -280,16 +280,17 @@ class Database {
                } else {
                        $commentedSql = $sql;
                }
-               if ( $this->debug() ) {
-                       $sqlx = substr( $commentedSql, 0, 500 );
-                       $sqlx = strtr($sqlx,"\t\n",'  ');
-                       wfDebug( "SQL: $sqlx\n" );
-               }
-               
+
                # If DBO_TRX is set, start a transaction
                if ( ( $this->mFlags & DBO_TRX ) && !$this->trxLevel() && $sql != 'BEGIN' ) {
                        $this->begin();
                }
+
+               if ( $this->debug() ) {
+                       $sqlx = substr( $sql, 0, 500 );
+                       $sqlx = strtr($sqlx,"\t\n",'  ');
+                       wfDebug( "SQL: $sqlx\n" );
+               }
                
                # Do the query and handle errors
                $ret = $this->doQuery( $commentedSql );