1 | #include <Parsers/ASTUseQuery.h> |
---|---|
2 | #include <Interpreters/Context.h> |
3 | #include <Interpreters/InterpreterUseQuery.h> |
4 | #include <Common/typeid_cast.h> |
5 | |
6 | |
7 | namespace DB |
8 | { |
9 | |
10 | BlockIO InterpreterUseQuery::execute() |
11 | { |
12 | const String & new_database = query_ptr->as<ASTUseQuery &>().database; |
13 | context.getSessionContext().setCurrentDatabase(new_database); |
14 | return {}; |
15 | } |
16 | |
17 | } |
18 |