From a0d178740a8e44aab7d79e1ce4f6f8bf6a9ab521 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 5 Apr 2014 08:54:11 +0200 Subject: [PATCH] Fix usage of $wgDebugDumpSql - In DatabaseMssql, use $this->debug() instead of $wgDebugDumpSql so that it takes into account the DBO_DEBUG flag - Use the same construction to set the DBO_DEBUG flag in LBFactorySimple::newMainLB() as for the other flags so that it is easier to read the code Change-Id: Ie775cdb3677739a97e0d64dabbf80fc685149337 --- includes/db/DatabaseMssql.php | 3 +-- includes/db/LBFactory.php | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index 50b7158332..faed99654f 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -164,8 +164,7 @@ class DatabaseMssql extends DatabaseBase { * @throws DBUnexpectedError */ protected function doQuery( $sql ) { - global $wgDebugDumpSql; - if ( $wgDebugDumpSql ) { + if ( $this->debug() ) { wfDebug( "SQL: [$sql]\n" ); } $this->offset = 0; diff --git a/includes/db/LBFactory.php b/includes/db/LBFactory.php index fcce8704af..eca9564903 100644 --- a/includes/db/LBFactory.php +++ b/includes/db/LBFactory.php @@ -243,7 +243,10 @@ class LBFactorySimple extends LBFactory { global $wgDBserver, $wgDBuser, $wgDBpassword, $wgDBname, $wgDBtype, $wgDebugDumpSql; global $wgDBssl, $wgDBcompress; - $flags = ( $wgDebugDumpSql ? DBO_DEBUG : 0 ) | DBO_DEFAULT; + $flags = DBO_DEFAULT; + if ( $wgDebugDumpSql ) { + $flags |= DBO_DEBUG; + } if ( $wgDBssl ) { $flags |= DBO_SSL; } -- 2.20.1