dotnet / dotnet/efcore

Query: incorrect results for queries projecting collections with distinct/group by, where we use projection as identifiers and all the columns are nullable

Open
#31,277 1 comment 1 reaction 0 assignees View on GitHub
area-query breaking-change
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

To mitigate the problem with insufficient information in case of Distinct and GroupBy, we use the projection/ group key as identifiers (see #22049). However, this is not correct if all the would-be identifiers are nullable. If that's the case and the values of all those columns would be null, we are not able to distinguish between empty set and set containing null value. (in fact, we would treat every null value as a new empty collection).

We should detect this and throw to prevent data corruption. (This is a breaking change - bad results only happen in case of null values, so if one has nullable columns without null values, everything was working fine, and now it would throw)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.