aboutsummaryrefslogtreecommitdiffstats
path: root/includes/db/MWLBFactory.php
diff options
context:
space:
mode:
authorAaron Schulz <aschulz@wikimedia.org>2019-05-06 17:01:03 -0700
committerAaron Schulz <aschulz@wikimedia.org>2019-05-08 14:58:10 -0700
commite0cc49ce3971e19ef7b18c3e89897979564d3a01 (patch)
treec2e1b1fdd99d841e9f3605d18c6df590faf8e3ce /includes/db/MWLBFactory.php
parent25ee9366b06a44087e8f0cba1f2b27324259ef52 (diff)
downloadmediawikicore-e0cc49ce3971e19ef7b18c3e89897979564d3a01.tar.gz
mediawikicore-e0cc49ce3971e19ef7b18c3e89897979564d3a01.zip
rdbms: improve query logging logic in Database
* Merge the two debug() calls in attemptQuery() into one single call which checks DBO_DEBUG. This avoids pointless SPI logger overhead. * Avoid calling generalizeSQL() unless actually necessary. This works via a lazy-loading object. * Make lastQuery() a bit more consistent in terms of when it gets updated. * Add DBQueryDisconnectedError class for dropped connections. * Clean up visbility and names of last query/error fields. Change-Id: Ie8df3434d23b18f7a0f4c056d71388192cc52c6b
Diffstat (limited to 'includes/db/MWLBFactory.php')
-rw-r--r--includes/db/MWLBFactory.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/includes/db/MWLBFactory.php b/includes/db/MWLBFactory.php
index be4f6ba57c31..5b629844b4c6 100644
--- a/includes/db/MWLBFactory.php
+++ b/includes/db/MWLBFactory.php
@@ -56,6 +56,7 @@ abstract class MWLBFactory {
'DBuser',
'DBWindowsAuthentication',
'DebugDumpSql',
+ 'DebugLogFile',
'ExternalServers',
'SQLiteDataDir',
'SQLMode',
@@ -206,6 +207,7 @@ abstract class MWLBFactory {
$flags = DBO_DEFAULT;
$flags |= $options->get( 'DebugDumpSql' ) ? DBO_DEBUG : 0;
+ $flags |= $options->get( 'DebugLogFile' ) ? DBO_DEBUG : 0;
if ( $server['type'] === 'oracle' ) {
$flags |= $options->get( 'DBOracleDRCP' ) ? DBO_PERSISTENT : 0;
}