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-24.1: optbuilder: subject SELECT FOR UPDATE to sql_safe_updates #121466
Conversation
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 |
6562fea
to
7843df5
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.
Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @michae2)
7843df5
to
2e8b336
Compare
Fixes: #110131 Release note (sql change): With sql_safe_updates set to true, SELECT FOR UPDATE and SELECT FOR SHARE statements now return an error if they do not contain either a WHERE clause or LIMIT clause. Also, UPDATE and DELETE statements without WHERE clauses but with LIMIT clauses now bypass sql_safe_updates, which better matches MySQL behavior.
2e8b336
to
0278ec4
Compare
Backport 1/1 commits from #121403 on behalf of @michae2.
/cc @cockroachdb/release
Fixes: #110131
Release note (sql change): With sql_safe_updates set to true, SELECT FOR UPDATE and SELECT FOR SHARE statements now return an error if they do not contain either a WHERE clause or LIMIT clause.
Also, UPDATE and DELETE statements without WHERE clauses but with LIMIT clauses now bypass sql_safe_updates, which better matches MySQL behavior.
Release justification: add a guardrail to prevent a dangerous operation now that RC is GA.