-
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-24.3: sql: do not use fast-path-checks if there are row-level BEFORE triggers #134223
release-24.3: sql: do not use fast-path-checks if there are row-level BEFORE triggers #134223
Conversation
7ad8666
to
45ef588
Compare
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 |
45ef588
to
c8b28f0
Compare
@mgartner friendly ping |
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 3 of 3 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball, @mgartner, and @rytaft)
…gers This commit prevents a possible bug in uniqueness checks when the table has row-level BEFORE triggers. The issue is an optimization that attempts to inline INSERT values into the check, to avoid buffering. This inlining logic uses the input of the INSERT operator *before* row-level triggers are added, and so it does not observe any modifications made to the rows. This could in theory result in the check failing to detect duplicates, although I was unable to create a logictest to produce this result. Fixes #133329 Release note: None
c8b28f0
to
0029093
Compare
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
TFTR |
Backport 1/1 commits from #133330 on behalf of @DrewKimball.
/cc @cockroachdb/release
sql: do not inline INSERT values into checks if there are BEFORE triggers
This commit prevents a possible bug in uniqueness checks when the table has
row-level BEFORE triggers. The issue is an optimization that attempts to
inline INSERT values into the check, to avoid buffering. This inlining
logic uses the input of the INSERT operator before row-level triggers
are added, and so it does not observe any modifications made to the rows.
This could in theory result in the check failing to detect duplicates,
although I was unable to create a logictest to produce this result.
Fixes #133329
Release note: None
Release justification: bug fix for new functionality in 24.3