| 1 | #pragma once |
| 2 | |
| 3 | #include <Interpreters/IInterpreter.h> |
| 4 | #include <Parsers/IAST_fwd.h> |
| 5 | |
| 6 | |
| 7 | namespace DB |
| 8 | { |
| 9 | |
| 10 | class Context; |
| 11 | class ASTSetQuery; |
| 12 | |
| 13 | |
| 14 | /** Change one or several settings for the session or just for the current context. |
| 15 | */ |
| 16 | class InterpreterSetQuery : public IInterpreter |
| 17 | { |
| 18 | public: |
| 19 | InterpreterSetQuery(const ASTPtr & query_ptr_, Context & context_) |
| 20 | : query_ptr(query_ptr_), context(context_) {} |
| 21 | |
| 22 | /** Usual SET query. Set setting for the session. |
| 23 | */ |
| 24 | BlockIO execute() override; |
| 25 | |
| 26 | /** Set setting for current context (query context). |
| 27 | * It is used for interpretation of SETTINGS clause in SELECT query. |
| 28 | */ |
| 29 | void executeForCurrentContext(); |
| 30 | |
| 31 | private: |
| 32 | ASTPtr query_ptr; |
| 33 | Context & context; |
| 34 | }; |
| 35 | |
| 36 | |
| 37 | } |
| 38 | |