diff --git a/src/Interpreters/executeQuery.cpp b/src/Interpreters/executeQuery.cpp index c276842ea5e..77c8a6f1bf4 100644 --- a/src/Interpreters/executeQuery.cpp +++ b/src/Interpreters/executeQuery.cpp @@ -317,7 +317,7 @@ QueryLogElement logQueryStart( elem.query_views = info.views; } - if (settings.async_insert || async_insert) + if (async_insert) InterpreterInsertQuery::extendQueryLogElemImpl(elem, context); else if (interpreter) interpreter->extendQueryLogElem(elem, query_ast, context, query_database, query_table); @@ -538,7 +538,7 @@ void logExceptionBeforeStart( ASTPtr ast, const std::shared_ptr & query_span, UInt64 elapsed_millliseconds, - bool async_insert) + bool async_insert_flush) { auto query_end_time = std::chrono::system_clock::now(); @@ -572,7 +572,7 @@ void logExceptionBeforeStart( elem.formatted_query = queryToString(ast); } - if (async_insert) + if (async_insert_flush) elem.query_kind = IAST::QueryKind::AsyncInsertFlush; // We don't calculate databases, tables and columns when the query isn't able to start @@ -1139,7 +1139,16 @@ static std::tuple executeQueryImpl( /// Everything related to query log. { QueryLogElement elem = logQueryStart( - query_start_time, context, query_for_logging, ast, pipeline, interpreter, internal, query_database, query_table); + query_start_time, + context, + query_for_logging, + ast, + pipeline, + interpreter, + internal, + query_database, + query_table, + async_insert); /// Also make possible for caller to log successful query finish and exception during execution. auto finish_callback = [elem, context, diff --git a/src/Interpreters/executeQuery.h b/src/Interpreters/executeQuery.h index f1fe6b86b79..94b106bb5d8 100644 --- a/src/Interpreters/executeQuery.h +++ b/src/Interpreters/executeQuery.h @@ -83,7 +83,7 @@ QueryLogElement logQueryStart( bool internal, const String & query_database, const String & query_table, - bool async_insert = false); + bool async_insert); void logQueryFinish( QueryLogElement & elem, @@ -109,5 +109,5 @@ void logExceptionBeforeStart( ASTPtr ast, const std::shared_ptr & query_span, UInt64 elapsed_millliseconds, - bool async_insert = false); + bool async_insert_flush = false); }