Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Jul 8, 2023

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.

@roji roji changed the base branch from main to release/7.0 July 8, 2023 13:17
@roji roji changed the title Perform alias uniquification in ExecuteUpdate setters (#31133) Perform alias uniquification in ExecuteUpdate setters Jul 8, 2023
@roji roji changed the title Perform alias uniquification in ExecuteUpdate setters [release/7.x] Perform alias uniquification in ExecuteUpdate setters Jul 9, 2023
@ajcvickers ajcvickers added this to the 7.0.x milestone Jul 10, 2023
@wtgodbe wtgodbe merged commit 3330dee into dotnet:release/7.0 Aug 2, 2023
@ajcvickers ajcvickers removed this from the 7.0.x milestone Nov 14, 2023
@roji roji deleted the ExecuteUpdateAliasUniquification7.0 branch June 13, 2025 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQL aliases aren't uniquified in ExecuteUpdate setters

5 participants