mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-30 05:30:51 +00:00
495c6e03aa
* 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
20 lines
477 B
C++
20 lines
477 B
C++
#include <Parsers/ASTUseQuery.h>
|
|
#include <Interpreters/Context.h>
|
|
#include <Interpreters/InterpreterUseQuery.h>
|
|
#include <Access/AccessFlags.h>
|
|
#include <Common/typeid_cast.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
BlockIO InterpreterUseQuery::execute()
|
|
{
|
|
const String & new_database = query_ptr->as<ASTUseQuery &>().database;
|
|
getContext()->checkAccess(AccessType::SHOW_DATABASES, new_database);
|
|
getContext()->getSessionContext()->setCurrentDatabase(new_database);
|
|
return {};
|
|
}
|
|
|
|
}
|