mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 11:52:27 +00:00
18 lines
379 B
C++
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 {};
|
|
}
|
|
|
|
}
|