-
Notifications
You must be signed in to change notification settings - Fork 5.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
executor: disallow subquery in insert values clause reference upper scope (#16872) #16952
Conversation
/run-all-tests |
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
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
/run-all-tests |
/run-all-tests |
@sre-bot merge failed. |
/merge |
/run-all-tests |
@sre-bot merge failed. |
/run-check_release_note |
/rebuild |
/merge |
/run-all-tests |
cherry-pick #16872 to release-4.0
What problem does this PR solve?
Problem Summary:
Insert statements with subquery in value clause write incorrect values
What is changed and how it works?
What's Changed:
Prevent subquery in insert values clause referencing upper scope columns, these column expressions will not be treated as correlated columns.
This change is compatible with
pg
but notmysql
, the inserted table is not allowed to be used in insert value clause, eg:How it Works:
Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note
Fix the problem that
subquery
in insert value clause could reference upper scope resolved information