-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: handle AOST in multi-stmt implicit txn #97063
Conversation
1b8f3bd
to
23a36d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @rafiss and @Xiang-Gu)
pkg/sql/conn_executor_exec.go
line 816 at r1 (raw file):
// Implicit transactions can have multiple statements, so we need to check // if one has already been executed. if ex.implicitTxn() && !ex.extraTxnState.firstStmtExecuted {
Just to make sure I understand it correctly -- in this block, we set the planner's txn-state's timestamp with the one of the asof
stmt, as we assume there's only one statement, which is the as of
, running. We shouldn't do this if there're more than 1 stmts in the implicit txn.
Does it mean that if there're more than 1 statements, and the first one is an AS OF
, it still should work?
If so, maybe we can add this case to the logic test as well?
23a36d7
to
f00b5e7
Compare
Yeah that is correct. That's a good idea for a test! I added it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
f00b5e7
to
9e780cc
Compare
Release note (bug fix): Fixed a bug where the AS OF SYSTEM TIME clause was handled correctly in an implicit transaction that had multiple statements.
9e780cc
to
33c9c53
Compare
bors r=ZhouXing19 |
Build succeeded: |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from 33c9c53 to blathers/backport-release-22.2-97063: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 22.2.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
fixes #85066
Release note (bug fix): Fixed a bug where the AS OF SYSTEM TIME clause was handled correctly in an implicit transaction that had multiple statements.