Fix usage of $wgDebugDumpSql
authorAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sat, 5 Apr 2014 06:54:11 +0000 (08:54 +0200)
committerAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sat, 5 Apr 2014 06:54:11 +0000 (08:54 +0200)
- 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
includes/db/LBFactory.php

index 50b7158..faed996 100644 (file)
@@ -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;
index fcce870..eca9564 100644 (file)
@@ -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;
                        }