aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Interpreters/InterpreterTransactionControlQuery.h
blob: a66a740ce0ca1e1f494eb746aa051a1fc84b763d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include <Interpreters/IInterpreter.h>
#include <Parsers/IAST_fwd.h>

namespace DB
{

class InterpreterTransactionControlQuery : public IInterpreter
{
public:
    InterpreterTransactionControlQuery(const ASTPtr & query_ptr_, ContextMutablePtr context_)
    : query_context(context_)
    , query_ptr(query_ptr_)
    {
    }

    BlockIO execute() override;

    bool ignoreQuota() const override { return true; }
    bool ignoreLimits() const override { return true; }
    bool supportsTransactions() const override { return true; }

    BlockIO executeBegin(ContextMutablePtr session_context);
    BlockIO executeCommit(ContextMutablePtr session_context);
    static BlockIO executeRollback(ContextMutablePtr session_context);
    static BlockIO executeSetSnapshot(ContextMutablePtr session_context, UInt64 snapshot);

private:
    ContextMutablePtr query_context;
    ASTPtr query_ptr;
};

}