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; }
|
2022-01-31 22:27:55 +00:00
|
|
|
bool supportsTransactions() const override { return true; }
|
|
|
|
|
2021-06-02 20:08:57 +00:00
|
|
|
BlockIO executeBegin(ContextMutablePtr session_context);
|
2022-05-20 20:08:46 +00:00
|
|
|
BlockIO executeCommit(ContextMutablePtr session_context);
|
2021-11-08 18:56:09 +00:00
|
|
|
static BlockIO executeRollback(ContextMutablePtr session_context);
|
2022-03-18 13:33:59 +00:00
|
|
|
static BlockIO executeSetSnapshot(ContextMutablePtr session_context, UInt64 snapshot);
|
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;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|