ClickHouse/src/Interpreters/IInterpreter.cpp
Azat Khuzhin aee034a597 Use explicit template instantiation for SystemLog
- Move some code into module part to avoid dependency from IStorage in SystemLog
- Remove extra headers from SystemLog.h
- Rewrite some code that was relying on headers that was included by SystemLog.h

v2: rebase
v3: squash move into module part with explicit template instantiation
    (to make each commit self compilable after rebase)
2022-01-10 22:01:41 +03:00

25 lines
870 B
C++

#include <Interpreters/IInterpreter.h>
#include <Interpreters/QueryLog.h>
#include <Interpreters/Context.h>
namespace DB
{
void IInterpreter::extendQueryLogElem(
QueryLogElement & elem, const ASTPtr & ast, ContextPtr context, const String & query_database, const String & query_table) const
{
if (!query_database.empty() && query_table.empty())
{
elem.query_databases.insert(backQuoteIfNeed(query_database));
}
else if (!query_table.empty())
{
auto quoted_database = query_database.empty() ? backQuoteIfNeed(context->getCurrentDatabase())
: backQuoteIfNeed(query_database);
elem.query_databases.insert(quoted_database);
elem.query_tables.insert(quoted_database + "." + backQuoteIfNeed(query_table));
}
extendQueryLogElemImpl(elem, ast, context);
}
}