Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "START TRANSACTION WITH CAUSAL CONSISTENCY ONLY" #1162

Merged
9 changes: 6 additions & 3 deletions ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,10 @@ func (n *ExecuteStmt) Accept(v Visitor) (Node, bool) {
// See https://dev.mysql.com/doc/refman/5.7/en/commit.html
type BeginStmt struct {
stmtNode
Mode string
ReadOnly bool
Bound *TimestampBound
Mode string
ReadOnly bool
Bound *TimestampBound
CausalConsistencyOnly bool
}

// Restore implements Node interface.
Expand All @@ -414,6 +415,8 @@ func (n *BeginStmt) Restore(ctx *format.RestoreCtx) error {
return n.Bound.Timestamp.Restore(ctx)
}
}
} else if n.CausalConsistencyOnly {
ctx.WriteKeyWord("START TRANSACTION WITH CAUSAL CONSISTENCY ONLY")
} else {
ctx.WriteKeyWord("START TRANSACTION")
}
Expand Down
2 changes: 2 additions & 0 deletions misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ var tokenMap = map[string]int{
"CASCADED": cascaded,
"CASE": caseKwd,
"CAST": cast,
"CAUSAL": causal,
"CHAIN": chain,
"CHANGE": change,
"CHAR": charType,
Expand Down Expand Up @@ -233,6 +234,7 @@ var tokenMap = map[string]int{
"CONCURRENCY": concurrency,
"CONFIG": config,
"CONNECTION": connection,
"CONSISTENCY": consistency,
"CONSISTENT": consistent,
"CONSTRAINT": constraint,
"CONSTRAINTS": constraints,
Expand Down
Loading