ClickHouse/dbms/src/Interpreters/InterpreterUseQuery.cpp

17 lines
347 B
C++
Raw Normal View History

#include <Parsers/ASTUseQuery.h>
#include <Interpreters/Context.h>
#include <Interpreters/InterpreterUseQuery.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 = typeid_cast<const ASTUseQuery &>(*query_ptr).database;
context.getSessionContext().setCurrentDatabase(new_database);
return {};
2016-12-12 07:24:56 +00:00
}
}