Fixed discrepancy between default values of "log_queries" and "log_query_threads" settings [#CLICKHOUSE-4030]

This commit is contained in:
Alexey Milovidov 2018-09-28 06:40:09 +03:00
parent 03d85227d1
commit 169dbfe200

View File

@ -105,11 +105,14 @@ void ThreadStatus::finalizePerformanceCounters()
try
{
bool log_to_query_thread_log = global_context && query_context && query_context->getSettingsRef().log_query_threads.value != 0;
if (log_to_query_thread_log)
if (global_context && query_context)
{
auto & settings = query_context->getSettingsRef();
if (settings.log_queries && settings.log_query_threads)
if (auto thread_log = global_context->getQueryThreadLog())
logToQueryThreadLog(*thread_log);
}
}
catch (...)
{
tryLogCurrentException(log);