2021-03-31 17:55:04 +00:00
|
|
|
#pragma once
|
|
|
|
#include <Interpreters/IInterpreter.h>
|
|
|
|
#include <Parsers/IAST_fwd.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2021-06-02 20:08:57 +00:00
|
|
|
class InterpreterTransactionControlQuery : public IInterpreter
|
2021-03-31 17:55:04 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-06-02 20:08:57 +00:00
|
|
|
InterpreterTransactionControlQuery(const ASTPtr & query_ptr_, ContextMutablePtr context_)
|
|
|
|
: query_context(context_)
|
2021-05-13 18:48:36 +00:00
|
|
|
, query_ptr(query_ptr_)
|
2021-03-31 17:55:04 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
BlockIO execute() override;
|
|
|
|
|
|
|
|
bool ignoreQuota() const override { return true; }
|
|
|
|
bool ignoreLimits() const override { return true; }
|
|
|
|
private:
|
2021-06-02 20:08:57 +00:00
|
|
|
BlockIO executeBegin(ContextMutablePtr session_context);
|
2021-11-08 18:56:09 +00:00
|
|
|
static BlockIO executeCommit(ContextMutablePtr session_context);
|
|
|
|
static BlockIO executeRollback(ContextMutablePtr session_context);
|
2021-03-31 17:55:04 +00:00
|
|
|
|
|
|
|
private:
|
2021-06-02 20:08:57 +00:00
|
|
|
ContextMutablePtr query_context;
|
2021-03-31 17:55:04 +00:00
|
|
|
ASTPtr query_ptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|