Skip to content
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/7.0] Use correct parameter in query based on type mapping #29724

Merged
merged 1 commit into from
Jan 4, 2023

Conversation

roji
Copy link
Member

@roji roji commented Dec 1, 2022

Fixes #29646, backports #29650

Description

When the same parameter is used in a query in contexts which require different type mappings, we sometimes use the incorrect type mapping in the incorrect context.

Customer impact

Since the incorrect SQL representation or parameter may be sent to the server, LINQ queries may return incorrect data. For example, if the same .NET string is compared against both Unicode and non-Unicode database columns in a query, that could yield wrong results.

How found

Customer reported on 7.0

Regression

Yes.

Testing

Added a test for the affected scenario.

Risk

Low; the fix is quite trivial, and a quirk was added to revert back to older behavior.

@roji roji requested a review from a team December 1, 2022 08:53
@rbhanda rbhanda added this to the 7.0.3 milestone Dec 6, 2022
@wtgodbe wtgodbe merged commit 727e46a into dotnet:release/7.0 Jan 4, 2023
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.

4 participants