Skip to content

Commit 029b8bc

Browse files
committed
Merge branch 'PomeloFoundation-main' into net9
2 parents bf0cd56 + bfc34f0 commit 029b8bc

File tree

10 files changed

+64
-13
lines changed

10 files changed

+64
-13
lines changed

Development.props.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
referenced by Microsoft.AspNetCore.Identity.EntityFrameworkCore
1717
(e.g. "6.0.0.0").
1818

19-
To achive that, run the following command in your EntityFrameworkCore
19+
To achieve that, run the following command in your EntityFrameworkCore
2020
base directory:
2121

2222
dotnet build "/p:AssemblyVersion=6.0.0.0"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Release | Branch
3131

3232
### Supported Database Servers and Versions
3333

34-
`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.
34+
`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.
3535

3636
Currently tested versions are:
3737

Version.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
rules.
1212
-->
1313
<VersionPrefix>9.0.0</VersionPrefix>
14-
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
15-
<PreReleaseVersionIteration>4</PreReleaseVersionIteration>
14+
<PreReleaseVersionLabel>rc</PreReleaseVersionLabel>
15+
<PreReleaseVersionIteration>1</PreReleaseVersionIteration>
1616

1717
<!--
1818
A string like `.efcore.9.0.0` or `.efcore.9.0.0.preview.1` can be added to the version suffix, to indicate that this release targets

src/EFCore.MySql/Infrastructure/MariaDbServerVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Microsoft.EntityFrameworkCore
1515
public class MariaDbServerVersion : ServerVersion
1616
{
1717
public static readonly string MariaDbTypeIdentifier = nameof(ServerType.MariaDb).ToLowerInvariant();
18-
public static readonly ServerVersion LatestSupportedServerVersion = new MariaDbServerVersion(new Version(11, 3, 2));
18+
public static readonly ServerVersion LatestSupportedServerVersion = new MariaDbServerVersion(new Version(11, 6, 2));
1919

2020
public override ServerVersionSupport Supports { get; }
2121

src/EFCore.MySql/Infrastructure/MySqlServerVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Microsoft.EntityFrameworkCore
1515
public class MySqlServerVersion : ServerVersion
1616
{
1717
public static readonly string MySqlTypeIdentifier = nameof(ServerType.MySql).ToLowerInvariant();
18-
public static readonly ServerVersion LatestSupportedServerVersion = new MySqlServerVersion(new Version(8, 0, 36));
18+
public static readonly ServerVersion LatestSupportedServerVersion = new MySqlServerVersion(new Version(8, 4, 3));
1919

2020
public override ServerVersionSupport Supports { get; }
2121

src/EFCore.MySql/Query/Internal/MySqlQueryCompilationContext.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Pomelo Foundation. All rights reserved.
22
// Licensed under the MIT. See LICENSE in the project root for license information.
33

4+
using System.Collections.Generic;
45
using JetBrains.Annotations;
56
using Microsoft.EntityFrameworkCore.Query;
67

@@ -10,13 +11,27 @@ public class MySqlQueryCompilationContext : RelationalQueryCompilationContext
1011
{
1112
public MySqlQueryCompilationContext(
1213
[NotNull] QueryCompilationContextDependencies dependencies,
13-
[NotNull] RelationalQueryCompilationContextDependencies relationalDependencies, bool async)
14+
[NotNull] RelationalQueryCompilationContextDependencies relationalDependencies,
15+
bool async)
1416
: base(dependencies, relationalDependencies, async)
1517
{
1618
}
1719

20+
public MySqlQueryCompilationContext(
21+
[NotNull] QueryCompilationContextDependencies dependencies,
22+
[NotNull] RelationalQueryCompilationContextDependencies relationalDependencies,
23+
bool async,
24+
bool precompiling,
25+
IReadOnlySet<string> nonNullableReferenceTypeParameters)
26+
: base(dependencies, relationalDependencies, async, precompiling, nonNullableReferenceTypeParameters)
27+
{
28+
}
29+
1830
public override bool IsBuffering
1931
=> base.IsBuffering ||
2032
QuerySplittingBehavior == Microsoft.EntityFrameworkCore.QuerySplittingBehavior.SplitQuery;
33+
34+
/// <inheritdoc />
35+
public override bool SupportsPrecompiledQuery => false;
2136
}
2237
}

src/EFCore.MySql/Query/Internal/MySqlQueryCompilationContextFactory.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Pomelo Foundation. All rights reserved.
22
// Licensed under the MIT. See LICENSE in the project root for license information.
33

4+
using System.Collections.Generic;
45
using JetBrains.Annotations;
56
using Microsoft.EntityFrameworkCore.Query;
67
using Microsoft.EntityFrameworkCore.Utilities;
@@ -25,5 +26,9 @@ public MySqlQueryCompilationContextFactory(
2526

2627
public virtual QueryCompilationContext Create(bool async)
2728
=> new MySqlQueryCompilationContext(_dependencies, _relationalDependencies, async);
29+
30+
public virtual QueryCompilationContext CreatePrecompiled(bool async, IReadOnlySet<string> nonNullableReferenceTypeParameters)
31+
=> new MySqlQueryCompilationContext(
32+
_dependencies, _relationalDependencies, async, precompiling: true, nonNullableReferenceTypeParameters);
2833
}
2934
}

test/EFCore.MySql.FunctionalTests/MySqlComplianceTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public class MySqlComplianceTest : RelationalComplianceTestBase
3838
// TODO: 9.0
3939
typeof(AdHocComplexTypeQueryTestBase),
4040
typeof(AdHocPrecompiledQueryRelationalTestBase),
41-
typeof(JsonQueryRelationalTestBase<>),
4241
typeof(PrecompiledQueryRelationalTestBase),
4342
typeof(PrecompiledSqlPregenerationQueryRelationalTestBase),
4443

@@ -48,7 +47,7 @@ public class MySqlComplianceTest : RelationalComplianceTestBase
4847

4948
// We have our own JSON support for now
5049
typeof(AdHocJsonQueryTestBase),
51-
typeof(AdHocJsonQueryRelationalTestBase),
50+
typeof(JsonQueryRelationalTestBase<>),
5251
typeof(JsonQueryTestBase<>),
5352
typeof(JsonTypesRelationalTestBase),
5453
typeof(JsonTypesTestBase),

test/EFCore.MySql.FunctionalTests/TestUtilities/MySqlTestHelpers.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,11 @@ public static string MySqlBug96947Workaround(string innerSql, string type = "cha
128128

129129
public static bool HasPrimitiveCollectionsSupport<TContext>(SharedStoreFixtureBase<TContext> fixture)
130130
where TContext : DbContext
131-
{
132-
return AppConfig.ServerVersion.Supports.JsonTable &&
133-
fixture.CreateOptions().GetExtension<MySqlOptionsExtension>().PrimitiveCollectionsSupport;
134-
}
131+
=> HasPrimitiveCollectionsSupport(fixture.CreateOptions());
132+
133+
public static bool HasPrimitiveCollectionsSupport(DbContextOptions options)
134+
=> AppConfig.ServerVersion.Supports.JsonTable &&
135+
options.GetExtension<MySqlOptionsExtension>().PrimitiveCollectionsSupport;
135136

136137
/// <summary>
137138
/// Same implementation as EF Core base class, except that it can generate code for Task returning test without a `bool async`

test/EFCore.MySql.FunctionalTests/Update/StoredProcedureUpdateMySqlTest.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,37 @@ CREATE PROCEDURE EntityWithAdditionalProperty_Insert(pName text, OUT pId int, pA
614614
WHERE `Id` = @p2 AND `AdditionalProperty` = @p3;
615615
SELECT ROW_COUNT();
616616
617+
SET @_out_p4 = NULL;
618+
CALL `EntityWithAdditionalProperty_Insert`(@p5, @_out_p4, @p6);
619+
SELECT @_out_p4;
620+
""");
621+
}
622+
623+
public override async Task Non_sproc_followed_by_sproc_commands_in_the_same_batch(bool async)
624+
{
625+
await base.Non_sproc_followed_by_sproc_commands_in_the_same_batch(
626+
async,
627+
"""
628+
CREATE PROCEDURE EntityWithAdditionalProperty_Insert(pName text, OUT pId int, pAdditional_property int)
629+
BEGIN
630+
INSERT INTO EntityWithAdditionalProperty (`Name`, `AdditionalProperty`) VALUES (pName, pAdditional_property);
631+
SET pId = LAST_INSERT_ID();
632+
END
633+
""");
634+
635+
AssertSql(
636+
"""
637+
@p2='1'
638+
@p0='2'
639+
@p3='1'
640+
@p1='Entity1_Modified' (Size = 4000)
641+
@p5='Entity2' (Size = 4000)
642+
@p6='0'
643+
644+
UPDATE `EntityWithAdditionalProperty` SET `AdditionalProperty` = @p0, `Name` = @p1
645+
WHERE `Id` = @p2 AND `AdditionalProperty` = @p3;
646+
SELECT ROW_COUNT();
647+
617648
SET @_out_p4 = NULL;
618649
CALL `EntityWithAdditionalProperty_Insert`(@p5, @_out_p4, @p6);
619650
SELECT @_out_p4;

0 commit comments

Comments
 (0)