[release/7.x] Perform alias uniquification in ExecuteUpdate setters#31208
Merged
wtgodbe merged 1 commit intodotnet:release/7.0from Aug 2, 2023
Merged
Conversation
Fixes dotnet#31078 (cherry picked from commit 8e4acf4)
maumar
approved these changes
Jul 9, 2023
ajcvickers
approved these changes
Jul 10, 2023
This file contains hidden or 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
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.
Fixes #31078
Backports #31133
Description
When generating SQL for the setters in an ExecuteUpdate query, we weren't doing proper SQL alias uniquification on the setter value expression
Customer impact
When an ExecuteUpdate is used with a setter than contains a subquery, the resulting SQL may have incorrect duplicate aliases, resulting in incorrect data.
How found
Customer reported for 7.0
Regression
No, ExecuteUpdate was a new feature in 7.0.
Testing
Added regression tests.
Risk
Very low; single-line fix, and this PR also introduces a quirk.