From: Chad Horohoe Date: Fri, 6 Jan 2012 18:23:52 +0000 (+0000) Subject: (bug 32787) Add DB name to debug output. Based on patch by Solitarius X-Git-Tag: 1.31.0-rc.0~25471 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=2e0bc11bd7070e2ef5a3832b5b1cf5fb14d5546d;p=lhc%2Fweb%2Fwiklou.git (bug 32787) Add DB name to debug output. Based on patch by Solitarius --- diff --git a/includes/db/Database.php b/includes/db/Database.php index be8d332b2c..4bf3409874 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -846,11 +846,9 @@ abstract class DatabaseBase implements DatabaseType { $sqlx = substr( $commentedSql, 0, 500 ); $sqlx = strtr( $sqlx, "\t\n", ' ' ); - if ( $isMaster ) { - wfDebug( "Query $cnt (master): $sqlx\n" ); - } else { - wfDebug( "Query $cnt (slave): $sqlx\n" ); - } + + $master = $isMaster ? 'master' : 'slave'; + wfDebug( "Query {$this->mDBname} ($cnt) ($master): $sqlx\n" ); } if ( istainted( $sql ) & TC_MYSQL ) {