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

AssertIncludeCollection ordering of elements issue #22293

Closed
roji opened this issue Aug 28, 2020 · 2 comments
Closed

AssertIncludeCollection ordering of elements issue #22293

roji opened this issue Aug 28, 2020 · 2 comments
Assignees
Labels
area-test closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@roji
Copy link
Member

roji commented Aug 28, 2020

When syncing EFCore.PG to the latest rc1 daily, all split tests under TPTRelationshipsQueryNpgsqlTest are failing with incorrect results.

Looking at test Include_collection_with_inheritance_split, the 2nd query for SQL Server is:

SELECT [b0].[BaseInheritanceRelationshipEntityId], [b0].[Id], [b0].[Name], [b].[Id]
FROM [BaseEntities] AS [b]
INNER JOIN [BaseEntities_OwnedCollectionOnBase] AS [b0] ON [b].[Id] = [b0].[BaseInheritanceRelationshipEntityId]
ORDER BY [b].[Id]

For SQL Server, this yields:

BaseInheritanceRelationshipEntityId Id Name Id
1 1 OCOB11 1
1 2 OCOB12 1
2 3 OCOB21 2
4 4 OCOB41 4
4 5 OCOB42 4
5 6 OCOB51 5

But PostgreSQL yields:

BaseInheritanceRelationshipEntityId Id Name Id
1 1 OCOB11 1
1 2 OCOB12 1
2 3 OCOB21 2
4 5 OCOB42 4
4 4 OCOB41 4
5 6 OCOB51 5

Since the query orders only by [b].[Id] and there are duplicates, row ordering seems non-deterministic...

/cc @smitpatel @AndriySvyryd

@smitpatel
Copy link
Member

@maumar - Can you investigate why the ordering on the collection is not happening in client side when asserting results?

@smitpatel smitpatel changed the title Ordering determinism issue in TPT split queries? AssertIncludeCollection ordering of elements issue Aug 28, 2020
@ajcvickers ajcvickers added this to the 5.0.0 milestone Aug 28, 2020
@maumar maumar modified the milestones: 5.0.0, MQ Sep 1, 2020
maumar added a commit that referenced this issue Sep 1, 2020
Adding sorting to the verification code for owned collections in the InheritanceRelationships query test infra.
maumar added a commit that referenced this issue Sep 1, 2020
Adding sorting to the verification code for owned collections in the InheritanceRelationships query test infra.
ghost pushed a commit that referenced this issue Sep 1, 2020
…22345)

Adding sorting to the verification code for owned collections in the InheritanceRelationships query test infra.
@smitpatel smitpatel modified the milestones: MQ, 5.0.0-rc1 Sep 1, 2020
@smitpatel smitpatel added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Sep 1, 2020
@smitpatel
Copy link
Member

Fixed via c57c5ce

@ajcvickers ajcvickers modified the milestones: 5.0.0-rc1, 5.0.0 Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-test closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants