From 3a79088579c185af4d724d3dc236f17e2f22b44c Mon Sep 17 00:00:00 2001 From: Laurents Meyer Date: Fri, 18 Jul 2025 14:32:47 +0200 Subject: [PATCH] Prepare RC release. --- Development.props.sample | 2 +- Directory.Packages.props | 3 +++ README.md | 2 +- .../Infrastructure/MariaDbServerVersion.cs | 2 +- .../Infrastructure/MySqlServerVersion.cs | 2 +- .../Internal/MySqlQueryCompilationContext.cs | 17 ++++++++++++++++- .../MySqlQueryCompilationContextFactory.cs | 5 +++++ .../MySqlComplianceTest.cs | 2 +- .../TestUtilities/MySqlTestHelpers.cs | 9 +++++---- 9 files changed, 34 insertions(+), 10 deletions(-) diff --git a/Development.props.sample b/Development.props.sample index f317cd552..9e757ef5c 100644 --- a/Development.props.sample +++ b/Development.props.sample @@ -16,7 +16,7 @@ referenced by Microsoft.AspNetCore.Identity.EntityFrameworkCore (e.g. "6.0.0.0"). - To achive that, run the following command in your EntityFrameworkCore + To achieve that, run the following command in your EntityFrameworkCore base directory: dotnet build "/p:AssemblyVersion=6.0.0.0" diff --git a/Directory.Packages.props b/Directory.Packages.props index f51a5e904..c4e17801f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,5 +1,8 @@ + [9.0.0,9.0.999] diff --git a/README.md b/README.md index 6076542ed..6cf81366c 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Release | Branch ### Supported Database Servers and Versions -`Pomelo.EntityFrameworkCore.MySql` is tested against all actively maintained versions of `MySQL` and `MariaDB`. Older versions (e.g. MySQL 5.7) and other server implementations (e.g. Amazon Aurora) are usually compatible to a high degree as well, but are not tested as part of our CI. You can find the versions a release was tested against within its [release](https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/releases) notes. +`Pomelo.EntityFrameworkCore.MySql` is tested against all actively maintained versions of `MySQL` and `MariaDB`. Older versions (e.g. MySQL 5.7) and other server implementations (e.g. Amazon Aurora) are usually compatible to a high degree as well, but are not tested as part of our CI. You can find a list of the versions, a release was tested against, within its [release](https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/releases) notes. Currently tested versions are: diff --git a/src/EFCore.MySql/Infrastructure/MariaDbServerVersion.cs b/src/EFCore.MySql/Infrastructure/MariaDbServerVersion.cs index c5f55d110..15561e9dc 100644 --- a/src/EFCore.MySql/Infrastructure/MariaDbServerVersion.cs +++ b/src/EFCore.MySql/Infrastructure/MariaDbServerVersion.cs @@ -15,7 +15,7 @@ namespace Microsoft.EntityFrameworkCore public class MariaDbServerVersion : ServerVersion { public static readonly string MariaDbTypeIdentifier = nameof(ServerType.MariaDb).ToLowerInvariant(); - public static readonly ServerVersion LatestSupportedServerVersion = new MariaDbServerVersion(new Version(11, 3, 2)); + public static readonly ServerVersion LatestSupportedServerVersion = new MariaDbServerVersion(new Version(11, 6, 2)); public override ServerVersionSupport Supports { get; } diff --git a/src/EFCore.MySql/Infrastructure/MySqlServerVersion.cs b/src/EFCore.MySql/Infrastructure/MySqlServerVersion.cs index d6d042bc7..ab0a3b2c5 100644 --- a/src/EFCore.MySql/Infrastructure/MySqlServerVersion.cs +++ b/src/EFCore.MySql/Infrastructure/MySqlServerVersion.cs @@ -15,7 +15,7 @@ namespace Microsoft.EntityFrameworkCore public class MySqlServerVersion : ServerVersion { public static readonly string MySqlTypeIdentifier = nameof(ServerType.MySql).ToLowerInvariant(); - public static readonly ServerVersion LatestSupportedServerVersion = new MySqlServerVersion(new Version(8, 0, 36)); + public static readonly ServerVersion LatestSupportedServerVersion = new MySqlServerVersion(new Version(8, 4, 3)); public override ServerVersionSupport Supports { get; } diff --git a/src/EFCore.MySql/Query/Internal/MySqlQueryCompilationContext.cs b/src/EFCore.MySql/Query/Internal/MySqlQueryCompilationContext.cs index ec2696ceb..f22945f5a 100644 --- a/src/EFCore.MySql/Query/Internal/MySqlQueryCompilationContext.cs +++ b/src/EFCore.MySql/Query/Internal/MySqlQueryCompilationContext.cs @@ -1,6 +1,7 @@ // Copyright (c) Pomelo Foundation. All rights reserved. // Licensed under the MIT. See LICENSE in the project root for license information. +using System.Collections.Generic; using JetBrains.Annotations; using Microsoft.EntityFrameworkCore.Query; @@ -10,13 +11,27 @@ public class MySqlQueryCompilationContext : RelationalQueryCompilationContext { public MySqlQueryCompilationContext( [NotNull] QueryCompilationContextDependencies dependencies, - [NotNull] RelationalQueryCompilationContextDependencies relationalDependencies, bool async) + [NotNull] RelationalQueryCompilationContextDependencies relationalDependencies, + bool async) : base(dependencies, relationalDependencies, async) { } + public MySqlQueryCompilationContext( + [NotNull] QueryCompilationContextDependencies dependencies, + [NotNull] RelationalQueryCompilationContextDependencies relationalDependencies, + bool async, + bool precompiling, + IReadOnlySet nonNullableReferenceTypeParameters) + : base(dependencies, relationalDependencies, async, precompiling, nonNullableReferenceTypeParameters) + { + } + public override bool IsBuffering => base.IsBuffering || QuerySplittingBehavior == Microsoft.EntityFrameworkCore.QuerySplittingBehavior.SplitQuery; + + /// + public override bool SupportsPrecompiledQuery => false; } } diff --git a/src/EFCore.MySql/Query/Internal/MySqlQueryCompilationContextFactory.cs b/src/EFCore.MySql/Query/Internal/MySqlQueryCompilationContextFactory.cs index 70ce1c4fb..1b61b17f7 100644 --- a/src/EFCore.MySql/Query/Internal/MySqlQueryCompilationContextFactory.cs +++ b/src/EFCore.MySql/Query/Internal/MySqlQueryCompilationContextFactory.cs @@ -1,6 +1,7 @@ // Copyright (c) Pomelo Foundation. All rights reserved. // Licensed under the MIT. See LICENSE in the project root for license information. +using System.Collections.Generic; using JetBrains.Annotations; using Microsoft.EntityFrameworkCore.Query; using Microsoft.EntityFrameworkCore.Utilities; @@ -25,5 +26,9 @@ public MySqlQueryCompilationContextFactory( public virtual QueryCompilationContext Create(bool async) => new MySqlQueryCompilationContext(_dependencies, _relationalDependencies, async); + + public virtual QueryCompilationContext CreatePrecompiled(bool async, IReadOnlySet nonNullableReferenceTypeParameters) + => new MySqlQueryCompilationContext( + _dependencies, _relationalDependencies, async, precompiling: true, nonNullableReferenceTypeParameters); } } diff --git a/test/EFCore.MySql.FunctionalTests/MySqlComplianceTest.cs b/test/EFCore.MySql.FunctionalTests/MySqlComplianceTest.cs index 92dd77753..bffb0c3b3 100644 --- a/test/EFCore.MySql.FunctionalTests/MySqlComplianceTest.cs +++ b/test/EFCore.MySql.FunctionalTests/MySqlComplianceTest.cs @@ -38,7 +38,6 @@ public class MySqlComplianceTest : RelationalComplianceTestBase // TODO: 9.0 typeof(AdHocComplexTypeQueryTestBase), typeof(AdHocPrecompiledQueryRelationalTestBase), - typeof(JsonQueryRelationalTestBase<>), typeof(PrecompiledQueryRelationalTestBase), typeof(PrecompiledSqlPregenerationQueryRelationalTestBase), @@ -48,6 +47,7 @@ public class MySqlComplianceTest : RelationalComplianceTestBase // We have our own JSON support for now typeof(AdHocJsonQueryTestBase), + typeof(JsonQueryRelationalTestBase<>), typeof(JsonQueryTestBase<>), typeof(JsonTypesRelationalTestBase), typeof(JsonTypesTestBase), diff --git a/test/EFCore.MySql.FunctionalTests/TestUtilities/MySqlTestHelpers.cs b/test/EFCore.MySql.FunctionalTests/TestUtilities/MySqlTestHelpers.cs index 3ff680ad5..6cdc029fc 100644 --- a/test/EFCore.MySql.FunctionalTests/TestUtilities/MySqlTestHelpers.cs +++ b/test/EFCore.MySql.FunctionalTests/TestUtilities/MySqlTestHelpers.cs @@ -128,10 +128,11 @@ public static string MySqlBug96947Workaround(string innerSql, string type = "cha public static bool HasPrimitiveCollectionsSupport(SharedStoreFixtureBase fixture) where TContext : DbContext - { - return AppConfig.ServerVersion.Supports.JsonTable && - fixture.CreateOptions().GetExtension().PrimitiveCollectionsSupport; - } + => HasPrimitiveCollectionsSupport(fixture.CreateOptions()); + + public static bool HasPrimitiveCollectionsSupport(DbContextOptions options) + => AppConfig.ServerVersion.Supports.JsonTable && + options.GetExtension().PrimitiveCollectionsSupport; /// /// Same implementation as EF Core base class, except that it can generate code for Task returning test without a `bool async`