ClickHouse/dbms/src/Interpreters/InterpreterUseQuery.cpp
2017-07-13 23:58:19 +03:00

18 lines
379 B
C++

#include <Parsers/ASTUseQuery.h>
#include <Interpreters/Context.h>
#include <Interpreters/InterpreterUseQuery.h>
#include <Common/typeid_cast.h>
namespace DB
{
BlockIO InterpreterUseQuery::execute()
{
const String & new_database = typeid_cast<const ASTUseQuery &>(*query_ptr).database;
context.getSessionContext().setCurrentDatabase(new_database);
return {};
}
}