-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.
Description
Background
This is a subtask of #21094. Ref #22765, #22506
pingcap/parser#1206 has implemented the syntax of AS OF clause, so we can replace begin a staleness read-only transaction with AS OF clause, which like:
START TRANSACTION READ ONLY AS OF TIMESTAMP '2020-02-02'
Note: The AS OF TIMESTAMP clause can be used only when the transaction is read-only. If the transaction contains any writes, or if the READ WRITE mode is specified, an error will be returned.
Implementation
Now that BeginStmt is marked with ReadOnly, we need to add AsOfClause in the statement. and then replace the origin process logic in #21897. and also we may need to implement the funcCallExpr, because we should judge the read_ts_in(xxxx,xxx). and should be noted the function is deterministic function.
- add the syntax in the
BeginStmt - replace the
with stalenesstoAS OFcluase
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type/enhancementThe issue or PR belongs to an enhancement.The issue or PR belongs to an enhancement.