Skip to content

Support for EF Core 10 and test fixes (MySQL 8+, ReadOnlySpan, collation)#2032

Closed
omarbaruzzo wants to merge 5 commits into
PomeloFoundation:mainfrom
omarbaruzzo:main
Closed

Support for EF Core 10 and test fixes (MySQL 8+, ReadOnlySpan, collation)#2032
omarbaruzzo wants to merge 5 commits into
PomeloFoundation:mainfrom
omarbaruzzo:main

Conversation

@omarbaruzzo

Copy link
Copy Markdown

Summary

This PR updates the solution for EF Core 10 compatibility and fixes several functional test failures encountered with current dependencies and MySQL 8+.

Changes

Library

  • MySqlQuerySqlGenerator: for single-argument aggregate functions (AVG, SUM, MIN, MAX, etc.), generate Name(arg) instead of calling base, to preserve the previous SQL shape and avoid breaking changes for users when EF Core 9.x started generating Name((arg)).

Tests

  • ReadOnlySpan / expression tree: replaced local arrays with List<T> in query tests where Contains() was used, so that the expression tree uses Enumerable.Contains instead of span-based overloads and the interpreter no longer fails (e.g. EscapesMySqlTestBase, GearsOfWarQueryMySqlTest, TPCGearsOfWarQueryMySqlTest, TPTGearsOfWarQueryMySqlTest).
  • Migrations: added [SupportedServerVersionCondition(DefaultExpression, AlternativeDefaultExpression)] to tests that add primitive collection columns with default values, so they are skipped on MySQL 5.7 where those defaults are not supported.
  • README (IntegrationTests, FunctionalTests): added a note that tests are intended to be run against MySQL 8.0+ or equivalent MariaDB.

Testing

  • Build and unit tests: OK
  • Integration tests: OK (with migrations and MySQL 8+)
  • Functional tests: OK (with MySQL 8+ and unicode_ci database where applicable)

Notes

  • Database for functional tests is expected to be MySQL 8.0+ (or equivalent MariaDB); some tests are skipped on older servers via version conditions.

Omar Baruzzo

@jackieevans3935

Copy link
Copy Markdown

@lauxjpn When is this PR going to be reviewed? Its been sitting for 2 weeks and has no response from you. We need to migrate to EF Core 10 and looking at weeks worth of work to migrate to Oracle's EF implementation.

@roji

roji commented Mar 3, 2026

Copy link
Copy Markdown

@jackieevans3935 this is an open source, volunteer-based project - as far as I know you're not paying the maintainers. So I'd at least tone down my language.

@jackieevans3935

jackieevans3935 commented Mar 3, 2026

Copy link
Copy Markdown

Fair point, I sponsored this project now to help give this migration the needed financial support

…T 10

Prima release del fork omarbaruzzo con provider allineato a Entity Framework Core
10.0.x e target framework net10.0. Il Pomelo ufficiale su NuGet (9.x) non e
compatibile con EF Core 10; questa linea e il riferimento per stack .NET 10.

Added:
- Target net10.0 per Pomelo.EntityFrameworkCore.MySql
- Supporto Microsoft.EntityFrameworkCore 10.0.x (Directory.Packages.props: 10.0.7)
- VisitRightJoin in MySqlBoolOptimizingExpressionVisitor (join destro EF Core 10)
- CHANGELOG.md con release 10.0.0 - 2026-05-28
- README: fork attivo, riga compatibilita 10.0.0 / EF 10 / .NET 10+

Changed:
- Directory.Build.props: PomeloTargetFramework e EfCoreTargetFramework -> net10.0
- Directory.Packages.props: allineamento dipendenze EF e Extensions a 10.0.7
- MySqlParameterBasedSqlProcessor: override Process(ParametersCacheDecorator);
  ProcessSqlNullability aggiornato per EF 10
- MySqlDbContextOptionsBuilderExtensions: UseParameterizedCollectionMode(Constant)
  al posto di TranslateParameterizedCollectionsToConstants (obsoleto)
- MySqlStringComparisonMethodTranslator: prefisso parametri __;
  QueryContext.Parameters al posto di ParameterValues / QueryParameterPrefix
- MySqlQueryCompilationContext / Factory: costruttore precompilazione a 4 parametri
- MySqlQueryableMethodTranslatingExpressionVisitor: [Obsolete] su override EF 10
- Check.cs (shared): messaggi ArgumentException inline per API EF 10
- Version.props: Version / OfficialVersion 10.0.0
- Directory.Build.props: PackageProjectUrl e RepositoryUrl -> fork omarbaruzzo

Fixed:
- MissingMethodException su AbstractionsStrings.ArgumentIsEmpty quando
  l'app usa EF Core 10 ma il provider era compilato contro EF 9

Note:
- Commit precedente sul branch: c44302e (feat: to ef-core-10), porting completato qui
- Repository: https://github.com/omarbaruzzo/Pomelo.EntityFrameworkCore.MySql
- Upstream: PomeloFoundation (linea EF 9.x); questo fork copre EF 10 / .NET 10
Align packages and test infrastructure with EF Core 10 breaking changes
(primary constructors, DisposeAsync test stores, RelationalCommand API,
parameterized collections, new abstract seeds) so the solution builds
and the MySQL functional suite runs against EF 10.0.7+.

- Bump EF Core and Microsoft.CodeAnalysis versions in Directory.Packages.props
- Vendor removed EF9 query/bulk-update base methods under test/Shared/Ef9VendoredBases
- Regenerate AssertSql baselines for EF10 SQL shape; adapt overrides and compliance
- Document skips for known MySQL/provider gaps (LIMIT with LEAST expression, bulk
  UPDATE/DELETE self-table subquery, EF JSON/ToJson, stored-proc collation)
- Fix LEAST/GREATEST SqlFunction type mapping inference in MySqlSqlTranslatingExpressionVisitor
- Extend MySqlComplianceTest.IgnoredTestBases for new EF10 test taxonomies not yet ported
- Update unit/integration test fixtures and suppress intentional raw-SQL/host warnings

Note: a small set of functional tests may still fail (migrations baselines, EF10
behavioral deltas, NativeAOT/BigModel, JSON migration scenarios). Full green is a
follow-up; this commit lands the bulk of the EF10 migration work.
Finish the EF Core 10 port on the provider side and align the functional test
suite with EF 10.0.8 so the fork builds against current packages and runs
without the temporary EF9 vendored test shims.

- Bump EF Core and Microsoft.Extensions packages to 10.0.8 in Directory.Packages.props
- Update query translation, JSON type mapping, update SQL generation, and metadata for EF 10 APIs
- Refresh JSON.Microsoft, JSON.Newtonsoft, and NetTopologySuite plugin projects
- Remove test/Shared/Ef9VendoredBases and wire tests back to upstream EF10 base classes
- Regenerate compiled-model baselines (BigModel, ComplexTypes, No_NativeAOT)
- Adapt functional test overrides, AssertSql expectations, and MySqlComplianceTest ignores
- Update unit and integration test fixtures and MySqlTestStore infrastructure

Note: verify the full MySQL functional suite locally before tagging a release.
@omarbaruzzo omarbaruzzo requested a review from a team as a code owner May 29, 2026 13:16
Raise the MySqlConnector connection timeout in CI and retry the functional test step so sporadic connect timeouts on the shared Docker database do not fail the entire matrix run.
@omarbaruzzo omarbaruzzo closed this by deleting the head repository May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants