-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
release-23.2: sql: mark implicit transactions with AOST as read-only #120158
Merged
michae2
merged 2 commits into
cockroachdb:release-23.2
from
michae2:backport23.2-120097
Mar 11, 2024
Merged
release-23.2: sql: mark implicit transactions with AOST as read-only #120158
michae2
merged 2 commits into
cockroachdb:release-23.2
from
michae2:backport23.2-120097
Mar 11, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks for opening a backport. Please check the backport criteria before merging:
If your backport adds new functionality, please ensure that the following additional criteria are satisfied:
Also, please add a brief release justification to the body of your PR to justify this |
Hold off for a sec, I need to fix it. |
In `handleAOST` we were setting the transaction AOST but not marking it as read-only. It needs to also be marked as read-only to disallow mutation statements and locking statements. Fixes: cockroachdb#120081 Release note (sql change): Mutation statements such as UPDATE and DELETE as well as locking statements such as SELECT FOR UPDATE are not allowed in read-only transactions or AS OF SYSTEM TIME transactions. Fix an oversight where we were allowing mutation statements and locking statements in implicit single-statement transactions using AS OF SYSTEM TIME.
Fixes: cockroachdb#44200 Release note (bug fix): Fix a bug in which it was possible to `SET transaction_read_only = false` during an AS OF SYSTEM TIME transaction.
c97dfe5
to
4f05854
Compare
rafiss
approved these changes
Mar 8, 2024
mgartner
approved these changes
Mar 11, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport 2/2 commits from #120097.
/cc @cockroachdb/release
sql: mark implicit transactions with AOST as read-only
In
handleAOST
we were setting the transaction AOST but not marking it as read-only. It needs to also be marked as read-only to disallow mutation statements and locking statements.Fixes: #120081
Release note (sql change): Mutation statements such as UPDATE and DELETE as well as locking statements such as SELECT FOR UPDATE are not allowed in read-only transactions or AS OF SYSTEM TIME transactions. Fix an oversight where we were allowing mutation statements and locking statements in implicit single-statement transactions using AS OF SYSTEM TIME.
sql: disallow SET transaction_read_only = false during AOST txn
Fixes: #44200
Release note (bug fix): Fix a bug in which it was possible to
SET transaction_read_only = false
during an AS OF SYSTEM TIME transaction.Release justification: add a missing check preventing undefined combination of AOST and mutation statements.