- 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
* @throws DBUnexpectedError
*/
protected function doQuery( $sql ) {
- global $wgDebugDumpSql;
- if ( $wgDebugDumpSql ) {
+ if ( $this->debug() ) {
wfDebug( "SQL: [$sql]\n" );
}
$this->offset = 0;
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;
}