ClickHouse/dbms/src/Interpreters/InterpreterUseQuery.cpp

18 lines
365 B
C++
Raw Normal View History

#include <Parsers/ASTUseQuery.h>
#include <Interpreters/Context.h>
#include <Interpreters/InterpreterUseQuery.h>
2017-07-13 20:58:19 +00:00
#include <Common/typeid_cast.h>
2016-12-12 07:24:56 +00:00
namespace DB
{
BlockIO InterpreterUseQuery::execute()
2016-12-12 07:24:56 +00:00
{
const String & new_database = query_ptr->as<ASTUseQuery &>().database;
context.getSessionContext().setCurrentDatabase(new_database);
return {};
2016-12-12 07:24:56 +00:00
}
}