2021-03-31 17:55:04 +00:00
|
|
|
#pragma once
|
|
|
|
#include <Parsers/IAST.h>
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
/// Common AST for TCL queries
|
|
|
|
class ASTTransactionControl : public IAST
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum QueryType
|
|
|
|
{
|
|
|
|
BEGIN,
|
|
|
|
COMMIT,
|
|
|
|
ROLLBACK,
|
2022-03-18 13:33:59 +00:00
|
|
|
SET_SNAPSHOT,
|
2021-03-31 17:55:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
QueryType action;
|
|
|
|
|
2022-03-18 13:33:59 +00:00
|
|
|
UInt64 snapshot; /// For SET TRANSACTION SNAPSHOT ...
|
|
|
|
|
2021-03-31 17:55:04 +00:00
|
|
|
ASTTransactionControl(QueryType action_) : action(action_) {}
|
|
|
|
|
|
|
|
String getID(char /*delimiter*/) const override { return "ASTTransactionControl"; }
|
|
|
|
ASTPtr clone() const override { return std::make_shared<ASTTransactionControl>(*this); }
|
|
|
|
|
|
|
|
void formatImpl(const FormatSettings & format, FormatState & /*state*/, FormatStateStacked /*frame*/) const override;
|
|
|
|
void updateTreeHashImpl(SipHash & hash_state) const override;
|
2023-02-02 01:11:16 +00:00
|
|
|
|
|
|
|
QueryKind getQueryKind() const override;
|
2021-03-31 17:55:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|