ClickHouse/src/Interpreters/IInterpreter.cpp

23 lines
786 B
C++
Raw Normal View History

2020-12-14 03:30:39 +00:00
#include <Interpreters/IInterpreter.h>
#include <Interpreters/QueryLog.h>
namespace DB
{
void IInterpreter::extendQueryLogElem(
2020-12-14 06:17:24 +00:00
QueryLogElement & elem, const ASTPtr & ast, const Context & context, const String & query_database, const String & query_table) const
2020-12-14 03:30:39 +00:00
{
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);
}
}