Syncs to the released .NET 11 preview 7 build (11.0.0-preview.7.26381.103) - #3897
Syncs to the released .NET 11 preview 7 build (11.0.0-preview.7.26381.103)#3897buvinghausen wants to merge 4 commits into
11.0.0-preview.7.26381.103)#3897Conversation
The released preview 7 build (11.0.0-preview.7.26381.103) adds GroupBy + DefaultIfEmpty projection tests for dotnet/efcore#30915, with a new abstract Seed30915 member on AdHocMiscellaneousQueryRelationalTestBase. Implement it following the SQL Server provider's seeding
The preview 7 runtime is required at test time: Microsoft.Extensions.Primitives moved into the shared framework, so running preview 7 packages on the preview 6 runtime fails with MissingMethodException (ChangeToken.OnChange) as soon as the test configuration loads. Also override Correlated_SelectMany_DefaultIfEmpty_whole_object: the base asserts a translation failure for providers without APPLY support, but PostgreSQL supports LATERAL, so the query translates and materializes correctly. Mirrors the SQL Server override, with the Npgsql SQL baseline.
11.0.0-preview.7.26381.103)
- Add NpgsqlParseTranslator: numeric Parse(string) -> CAST, mirroring SQL Server - Override NpgsqlArrayTypeMapping.GetDefaultProviderValue: native arrays get an array default, not the JSON "[]" string the base now assumes (dotnet/efcore#38796) - Add ~55 missing test overrides with PostgreSQL baselines; refresh 6 drifted ones - Override Join_local_*_closure tests (PG char-cast semantics; byte[] joins translate) - Reimplement owned-entity inconsistent-data test with quoted identifiers - Seed EntitiesWithPrimitiveCollection in the precompiled-query fixture Remaining failures are all dotnet/efcore#38796 (shaper assumes primitive collections are stored as JSON strings), pending an upstream fix.
|
@roji — this bump turned into a bit of a state-of-the-union, so here's where things stand. TL;DR: after the fixes in this PR, every remaining CI failure (~410 across PrimitiveCollectionsQuery*, JsonUpdate*, JsonQuery*, etc.) is a single upstream regression in the released preview 7 build, filed as dotnet/efcore#38796. There's nothing further to fix provider-side; once that's resolved in a new EF build this PR should go green as-is. The upstream blocker (dotnet/efcore#38796): since dotnet/efcore#38498 (6a2d7a8a), ShaperProcessingExpressionVisitor.CreateGetValueExpression takes a "read JSON string via JsonValueReaderWriter" path for any primitive-collection mapping that has a converter with ConvertsNulls: false and a JsonValueReaderWriter. Our native array mappings match those conditions whenever there's an element converter (enum arrays etc. via NpgsqlArrayConverter, provider type int[]), so the shaper emits Convert(int[], string) and query compilation throws No coercion operator is defined between types 'System.Int32[]' and 'System.String'. Since it fires while building the entity shaper, one such property poisons every query over that entity — hence entire test classes going red. What this PR now contains beyond the version bump:
Deferred pending #38796: the 5 overrides in JsonQueryNpgsqlTest / PrimitiveCollectionsQueryNpgsqlTest are plain base-call stubs — their baselines can't be captured while the shaper throws. Happy to do a follow-up pass to fill those in once a fixed build is available. |
|
Quick update: Given the upstream dumpster fire this repository inherited I fully do not expect you to publish a preview7 version to NuGet so no worries there I went ahead and published my fork's build to my private GitHub NuGet server so I can carry forwards fortunately I don't have any existing native scalars to array columns anywhere in my codebase so I won't hit it until this gets resolved. I'll leave this here for reference and perhaps we just carry it forwards to when RC1 drops next month just let me know. |
Summary
Bump EF Core / Microsoft.Extensions packages to
11.0.0-preview.7.26381.103Bump
global.jsonSDK to11.0.100-preview.7.26381.103— required, not justconvention: preview 7 moved
Microsoft.Extensions.Primitivesinto the sharedframework, so the new packages on the preview 6 runtime throw
MissingMethodException(ChangeToken.OnChange) when the functional testconfiguration loads.
Implement
Seed30915, newly abstract onAdHocMiscellaneousQueryRelationalTestBase(Nullable object must have a value thrown for a query with DefaultIfEmpty() dotnet/efcore#30915 test coverage); seeding copied from the SQL Server provider.
Override
Correlated_SelectMany_DefaultIfEmpty_whole_object: the base testasserts the "no APPLY support" translation failure (SQLite behavior), but
PostgreSQL supports
LATERAL, so the query translates and runs. The overridemirrors EF Core's SQL Server one and asserts the generated
LEFT JOIN LATERAL … ON TRUESQL.Verified locally against PostgreSQL (testcontainer):
AdHocMiscellaneousQueryNpgsqlTestpasses 120/121 (1 known-flaky skip)
Context
This version is expected to include dotnet/efcore#38586, which should have shipped in this preview. Opening this PR to validate that fix against Npgsql.EntityFrameworkCore.PostgreSQL since you explicitly lock preview versions the sooner I can get this released the better.
I've got SQL Server style temporal table support working but in order to fully and properly support crypto erasure in ASP.NET identity I need to break the user lockout properties and the password into a split table which itself is not-temporal so I'm blocked on testing at the moment.