From: Tim Starling Date: Mon, 28 Mar 2005 07:56:17 +0000 (+0000) Subject: Fixed ordering of SQL debug log X-Git-Tag: 1.5.0alpha1~477 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=7597b899d6df359af976c8c248b6ee6087ec5370;p=lhc%2Fweb%2Fwiklou.git Fixed ordering of SQL debug log --- diff --git a/includes/Database.php b/includes/Database.php index f367cf9b4f..7fe6ae9158 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -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 );