Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Dec 7, 2023

Fixes #32374, backports #32478

Description

The new EF 8.0 primitive collections support translates the parameterized Contains LINQ query to an OPENJSON-based subquery (WHERE x IN (SELECT ... FROM OPENJSON(@p))), instead of the older IN+constants construct (WHERE x IN (1, 2, 3)). Unfortunately, SQL Server doesn't support any subqueries in arguments to aggregate functions (e.g. SELECT COUNT(<something containing a subquery>). This limitation doesn't exist in any other database.

Customer impact

Any query requiring a parameterized Contains within an aggregate function now fail on SQL Server; such queries worked before.

How found

Customers reported on 8.0

Regression

Yes

Testing

Added

Risk

Low risk, very targeted change for SQL Server Contains only. Also added quirk.

@roji roji requested a review from maumar December 7, 2023 12:15
@ajcvickers ajcvickers added this to the 8.0.2 milestone Dec 12, 2023
@wtgodbe wtgodbe merged commit 079b67d into dotnet:release/8.0 Jan 3, 2024
@roji roji deleted the SqlServerAggregateStuff8 branch January 3, 2024 23:01
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.

5 participants