ClickHouse/src/Interpreters/IInterpreter.cpp
Ivan 495c6e03aa
Replace all Context references with std::weak_ptr (#22297)
* Replace all Context references with std::weak_ptr

* Fix shared context captured by value

* Fix build

* Fix Context with named sessions

* Fix copy context

* Fix gcc build

* Merge with master and fix build

* Fix gcc-9 build
2021-04-11 02:33:54 +03:00

24 lines
836 B
C++

#include <Interpreters/IInterpreter.h>
#include <Interpreters/QueryLog.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);
}
}