Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Query: Distinct on entity containing primitive array gives wrong results when projecting multiple collections due to result bucketing issues #31398

@maumar

Description

@maumar

we rely on property.GetKeyValueComparer() as comparers for identifiers in result coordinator. This can happen in case of Distinct/GroupBy, where we can't use key as identifier (if it's not projected).

Problem is that for collection of primitives, the comparer does ref comparison, so every row looks like a new element to the result coordinator, and we get data corruption.

As a simple workaround we can omit collection of primitives from identifier list, that works fine but would give wrong results still, if entities next to each other (in the collection) differ only by their collection of primitives. Proper fix is to use structural comparer (?)

@roji @ajcvickers

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions