mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 02:41:59 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
20 lines
464 B
C++
20 lines
464 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;
|
|
context.checkAccess(AccessType::SHOW_DATABASES, new_database);
|
|
context.getSessionContext().setCurrentDatabase(new_database);
|
|
return {};
|
|
}
|
|
|
|
}
|