mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 12:22:12 +00:00
18 lines
365 B
C++
18 lines
365 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 = query_ptr->as<ASTUseQuery &>().database;
|
|
context.getSessionContext().setCurrentDatabase(new_database);
|
|
return {};
|
|
}
|
|
|
|
}
|