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

Replace the WITH Staleness to AS OF clause #24291

Closed
2 tasks done
nolouch opened this issue Apr 26, 2021 · 1 comment · Fixed by #24813
Closed
2 tasks done

Replace the WITH Staleness to AS OF clause #24291

nolouch opened this issue Apr 26, 2021 · 1 comment · Fixed by #24813
Assignees

Comments

@nolouch
Copy link
Member

nolouch commented Apr 26, 2021

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 staleness to AS OF cluase
@JmPotato
Copy link
Member

/assign @JmPotato

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants