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

[6.0] Query: Throw for FromSql+Any pattern which has been mutated #26211

Merged
merged 1 commit into from
Oct 4, 2021

Conversation

smitpatel
Copy link
Contributor

@smitpatel smitpatel commented Sep 29, 2021

Part of #26167

Description

An exception is thrown for a certain pattern of raw SQL query that then uses .Any in LINQ. Fixing this for 6.0 is considered too risky, but we can detect when we're going to throw the exception, so we are making that exception more helpful. The workaround is to use .Count instead, which is pretty easy once it is known.

Customer impact

This is a relatively simple query, so we expect more customers to hit this. Helping them find the workaround will be useful.

How found

Customer reported.

Regression

Yes, in 6.0.

Testing

Tests added to make sure that the new exception is thrown.

Risk

Low. The fix just changes the exception thrown.

@smitpatel smitpatel force-pushed the smit/fromsql branch 2 times, most recently from 99a1895 to 033882e Compare September 29, 2021 21:38
@ajcvickers
Copy link
Member

@smitpatel Can we add tests that show that the workaround queries with Count work correctly?

@ajcvickers
Copy link
Member

@Pilchie for 6.0.

@Pilchie
Copy link
Member

Pilchie commented Oct 4, 2021

The scenario is approved for EFCore 6.0 GA, but please follow up on @ajcvickers comments in the PR before merging.

@smitpatel
Copy link
Contributor Author

Updated.

@smitpatel smitpatel changed the title Query: Throw for FromSql+Any pattern which has been mutated [6.0] Query: Throw for FromSql+Any pattern which has been mutated Oct 4, 2021
@smitpatel smitpatel merged commit b30f55d into release/6.0 Oct 4, 2021
@smitpatel smitpatel deleted the smit/fromsql branch October 4, 2021 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants