* for a successful read query, or false on failure if $tempIgnore set
*/
public function query( $sql, $fname = __METHOD__, $tempIgnore = false ) {
- global $wgUser, $wgDebugDBTransactions;
+ global $wgUser, $wgDebugDBTransactions, $wgDebugDumpSqlLength;
$this->mLastQuery = $sql;
if ( $this->isWriteQuery( $sql ) ) {
static $cnt = 0;
$cnt++;
- $sqlx = substr( $commentedSql, 0, 500 );
+ $sqlx = $wgDebugDumpSqlLength ? substr( $commentedSql, 0, $wgDebugDumpSqlLength )
+ : $commentedSql;
$sqlx = strtr( $sqlx, "\t\n", ' ' );
$master = $isMaster ? 'master' : 'slave';
if ( $this->ping() ) {
global $wgRequestTime;
wfDebug( "Reconnected\n" );
- $sqlx = substr( $commentedSql, 0, 500 );
+ $sqlx = $wgDebugDumpSqlLength ? substr( $commentedSql, 0, $wgDebugDumpSqlLength )
+ : $commentedSql;
$sqlx = strtr( $sqlx, "\t\n", ' ' );
$elapsed = round( microtime( true ) - $wgRequestTime, 3 );
if ( $elapsed < 300 ) {