Uh oh!
There was an error while loading. Please reload this page.
[release/11.0-rc1] Preserve discriminating ORDER BY for many-to-many collections - #38811
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes nondeterministic many-to-many collection materialization by retaining the final discriminating identifier in generated ORDER BY clauses.
Changes:
- Detects when surviving orderings contain only collection join keys.
- Seeds SQLite join rows out of key order for regression coverage.
- Updates SQL Server baselines across standard, temporal, TPT, and TPC queries.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/EFCore.Relational/Query/SqlExpressions/SelectExpression.cs | Preserves the required collection discriminator ordering. |
test/EFCore.Sqlite.FunctionalTests/ManyToManyLoadSqliteTestBase.cs | Introduces non-key-ordered join rows. |
test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyQuerySqlServerTest.cs | Updates SQL ordering baselines. |
test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerTest.cs | Updates temporal SQL baselines. |
test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPTManyToManyQuerySqlServerTest.cs | Updates TPT SQL baselines. |
test/EFCore.SqlServer.FunctionalTests/Query/Inheritance/TPCManyToManyQuerySqlServerTest.cs | Updates TPC SQL baselines. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Fixes#38770 Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
ad45764 to
c819f61CompareThere was a problem hiding this comment.
Pull request overview
Copilot reviewed 50 out of 50 changed files in this pull request and generated no new comments.
Suppressed comments (3)
test/EFCore.Sqlite.FunctionalTests/ManyToManyLoadSqliteTestBase.cs:23
- Configure the raw-SQL await not to capture a synchronization context, consistent with the repository's async-call requirement.
test/EFCore.Sqlite.FunctionalTests/ManyToManyLoadSqliteTestBase.cs:28 - Configure this new asynchronous database call not to capture a synchronization context.
test/EFCore.Sqlite.FunctionalTests/ManyToManyLoadSqliteTestBase.cs:21 - Configure the new await not to capture a synchronization context, as required for asynchronous calls in this repository.
This issue also appears in the following locations of the same file:
- line 23
- line 26
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
* Merge pull request #38837 from dotnet/darc-release/11.0-rc1-397e9f16-6eec-4c2a-a4d8-e46b06f86e54 [release/11.0-rc1] Source code updates from dotnet/dotnet * [release/11.0-rc1] Source code updates from dotnet/dotnet (#38841) Updated Dependencies: Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.Build.Tasks.Templating, Microsoft.DotNet.Helix.Sdk (Version 11.0.0-beta.26420.118 -> 11.0.0-beta.26421.101) Microsoft.Extensions.Caching.Memory, Microsoft.Extensions.Configuration, Microsoft.Extensions.Configuration.EnvironmentVariables, Microsoft.Extensions.Configuration.Json, Microsoft.Extensions.DependencyInjection, Microsoft.Extensions.DependencyModel, Microsoft.Extensions.HostFactoryResolver.Sources, Microsoft.Extensions.Logging, Microsoft.NETCore.App.Ref, Microsoft.NETCore.Platforms, System.Formats.Asn1, System.Runtime.Caching, System.Text.Encodings.Web, System.Text.Json (Version 11.0.0-rc.1.26420.118 -> 11.0.0-rc.1.26421.101) [[ commit created by automation ]] Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * [release/11.0-rc1] Fix query shaping for native primitive collections (#38810) Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> * [release/11.0-rc1] Preserve discriminating ORDER BY for many-to-many collections (#38811) Fixes#38770 Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com> --------- Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Many-to-many collection includes could omit their only varying identifier from
ORDER BY, making materialization order depend on the provider’s physical access path.Ordering logic
Regression coverage
ORDER BYloses its only discriminating column (regression in 11.0) #38770