From: Brion Vibber Date: Fri, 18 Mar 2005 04:22:05 +0000 (+0000) Subject: Include function name for SQL statements dumped to debug log X-Git-Tag: 1.5.0alpha1~595 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=7150b26584eaafe98ab7e3dd726d7cce4d444b4c;p=lhc%2Fweb%2Fwiklou.git Include function name for SQL statements dumped to debug log --- diff --git a/includes/Database.php b/includes/Database.php index 23645514a3..64004f6181 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -274,17 +274,17 @@ class Database { $this->mLastQuery = $sql; - if ( $this->debug() ) { - $sqlx = substr( $sql, 0, 500 ); - $sqlx = wordwrap(strtr($sqlx,"\t\n",' ')); - wfDebug( "SQL: $sqlx\n" ); - } # Add a comment for easy SHOW PROCESSLIST interpretation if ( $fname ) { $commentedSql = "/* $fname */ $sql"; } else { $commentedSql = $sql; } + if ( $this->debug() ) { + $sqlx = substr( $commentedSql, 0, 500 ); + $sqlx = wordwrap(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' ) {