From f3031ae6d36d2e7e755fbe5a87f10e8d3a5ea1bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delaporte?= <12201973+fredericDelaporte@users.noreply.github.com> Date: Tue, 28 Nov 2023 20:07:44 +0100 Subject: [PATCH 1/4] Fix DB2/400 schema generation on 5.3.x (#3451) Co-authored-by: Roman Artiukhin --- .github/workflows/GenerateAsyncCode.yml | 2 +- src/NHibernate/Dialect/DB2400Dialect.cs | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/GenerateAsyncCode.yml b/.github/workflows/GenerateAsyncCode.yml index dd2badb26c4..e505bf91508 100644 --- a/.github/workflows/GenerateAsyncCode.yml +++ b/.github/workflows/GenerateAsyncCode.yml @@ -27,7 +27,7 @@ jobs: run: | dotnet restore "./Tools/packages.csproj" --packages ./Tools pushd src - dotnet restore ./NHibernate.sln + dotnet restore ./NHibernate.sln /p:TreatWarningsAsErrors=false dotnet $(find ./../Tools/csharpasyncgenerator.commandline -name AsyncGenerator.CommandLine.dll) popd diff --git a/src/NHibernate/Dialect/DB2400Dialect.cs b/src/NHibernate/Dialect/DB2400Dialect.cs index aa306a0d05a..91a23b1a219 100644 --- a/src/NHibernate/Dialect/DB2400Dialect.cs +++ b/src/NHibernate/Dialect/DB2400Dialect.cs @@ -1,4 +1,6 @@ -using NHibernate.Cfg; +using System; +using System.Data.Common; +using NHibernate.Dialect.Schema; using NHibernate.SqlCommand; namespace NHibernate.Dialect @@ -23,7 +25,13 @@ public class DB2400Dialect : DB2Dialect { public DB2400Dialect() { - DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.DB2400Driver"; + DefaultProperties[Cfg.Environment.ConnectionDriver] = "NHibernate.Driver.DB2400Driver"; + } + + public override IDataBaseSchema GetDataBaseSchema(DbConnection connection) + { + // The DB2 implementation is not valid for DB2400. + throw new NotSupportedException(); } public override bool SupportsSequences @@ -61,4 +69,4 @@ public override bool SupportsVariableLimit get { return false; } } } -} \ No newline at end of file +} From 6d47db4ab4f117c40ebc8fb0d2332d30a9cfab87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delaporte?= <12201973+fredericDelaporte@users.noreply.github.com> Date: Wed, 29 Nov 2023 21:18:38 +0100 Subject: [PATCH 2/4] Release 5.3.20 (#3454) --- build-common/NHibernate.props | 2 +- releasenotes.txt | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/build-common/NHibernate.props b/build-common/NHibernate.props index 6cad2a32da7..2bc8d025dcf 100644 --- a/build-common/NHibernate.props +++ b/build-common/NHibernate.props @@ -3,7 +3,7 @@ 5.3 - 19 + 20 diff --git a/releasenotes.txt b/releasenotes.txt index c7317d2b4f6..732c2ca7df4 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -1,4 +1,20 @@ -Build 5.3.19 +Build 5.3.20 +============================= + +Release notes - NHibernate - Version 5.3.20 + +2 issues were resolved in this release. + +** Bug + + * #3438 DB2/400: ArgumentException Column 'SQL_TYPE_NAME' does not belong to table DataTypes + +** Task + + * #3454 Release 5.3.20 + + +Build 5.3.19 ============================= Release notes - NHibernate - Version 5.3.19 From 37f80d9cd1382a05bb8e65ef6c5e1a85b5f1e3ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delaporte?= <12201973+fredericDelaporte@users.noreply.github.com> Date: Wed, 29 Nov 2023 21:35:26 +0100 Subject: [PATCH 3/4] Migrate appveyor build to MySql 8 (#3453) Co-authored-by: Roman Artiukhin --- appveyor.yml | 4 ++-- src/NHibernate.Test/Async/Linq/MethodCallTests.cs | 8 +++++++- src/NHibernate.Test/Extralazy/UserGroup.hbm.xml | 2 +- src/NHibernate.Test/Linq/MethodCallTests.cs | 8 +++++++- .../NHSpecificTest/NH2113/Mappings.hbm.xml | 2 +- .../NHSpecificTest/NH2907/Mappings.hbm.xml | 4 ++-- src/NHibernate.Test/NHibernate.Test.csproj | 2 +- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index eb6fc4b2fc9..c9703d631ab 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -39,10 +39,10 @@ before_test: Pop-Location } 'MySQL' { - Start-Service 'MySQL57' + Start-Service 'MySQL80' # Create nhibernate database (not handled by NHibernate.TestDatabaseSetup.dll) $env:MYSQL_PWD = 'Password12!' - & 'C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql' -e 'CREATE DATABASE nhibernate CHARACTER SET utf8 COLLATE utf8_general_ci;' --user=root + & 'C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql' -e 'CREATE DATABASE nhibernate CHARACTER SET utf8 COLLATE utf8_general_ci;' --user=root } 'Odbc' { Start-Service 'MSSQL$SQL2017' } 'PostgreSQL' { diff --git a/src/NHibernate.Test/Async/Linq/MethodCallTests.cs b/src/NHibernate.Test/Async/Linq/MethodCallTests.cs index b3ba92bef4f..621aed6d57c 100644 --- a/src/NHibernate.Test/Async/Linq/MethodCallTests.cs +++ b/src/NHibernate.Test/Async/Linq/MethodCallTests.cs @@ -59,6 +59,7 @@ public async Task CanExecuteCountWithOrderByArgumentsAsync() public async Task CanSelectPropertiesIntoObjectArrayAsync() { var result = await (db.Users + .OrderBy(u => u.Id) .Select(u => new object[] {u.Id, u.Name, u.InvalidLoginAttempts}) .FirstAsync()); @@ -71,6 +72,7 @@ public async Task CanSelectPropertiesIntoObjectArrayAsync() public async Task CanSelectComponentsIntoObjectArrayAsync() { var result = await (db.Users + .OrderBy(u => u.Id) .Select(u => new object[] {u.Component, u.Component.OtherComponent}) .FirstAsync()); @@ -106,6 +108,7 @@ public async Task CanSelectConstantsIntoObjectArrayAsync() const string name = "Julian"; var result = await (db.Users + .OrderBy(u => u.Id) .Select(u => new object[] {u.Id, pi, name, DateTime.MinValue}) .FirstAsync()); @@ -119,6 +122,7 @@ public async Task CanSelectConstantsIntoObjectArrayAsync() public async Task CanSelectPropertiesFromAssociationsIntoObjectArrayAsync() { var result = await (db.Users + .OrderBy(u => u.Id) .Select(u => new object[] {u.Id, u.Role.Name, u.Role.Entity.Output}) .FirstAsync()); @@ -131,6 +135,7 @@ public async Task CanSelectPropertiesFromAssociationsIntoObjectArrayAsync() public async Task CanSelectPropertiesIntoObjectArrayInPropertyAsync() { var result = await (db.Users + .OrderBy(u => u.Id) .Select(u => new { Cells = new object[] { u.Id, u.Name, new object[u.Id] } }) .FirstAsync()); @@ -144,6 +149,7 @@ public async Task CanSelectPropertiesIntoObjectArrayInPropertyAsync() public async Task CanSelectPropertiesIntoPropertyListInPropertyAsync() { var result = await (db.Users + .OrderBy(u => u.Id) .Select(u => new { Cells = new List { u.Id, u.Name, new object[u.Id] } }) .FirstAsync()); @@ -156,7 +162,7 @@ public async Task CanSelectPropertiesIntoPropertyListInPropertyAsync() [Test, Description("NH-2744")] public async Task CanSelectPropertiesIntoNestedObjectArraysAsync() { - var query = db.Users.Select(u => new object[] {"Root", new object[] {"Sub1", u.Name, new object[] {"Sub2", u.Name}}}); + var query = db.Users.OrderBy(u => u.Id).Select(u => new object[] {"Root", new object[] {"Sub1", u.Name, new object[] {"Sub2", u.Name}}}); var result = await (query.FirstAsync()); Assert.That(result.Length, Is.EqualTo(2)); diff --git a/src/NHibernate.Test/Extralazy/UserGroup.hbm.xml b/src/NHibernate.Test/Extralazy/UserGroup.hbm.xml index 2dd3fb6433d..0bd06b06d9e 100644 --- a/src/NHibernate.Test/Extralazy/UserGroup.hbm.xml +++ b/src/NHibernate.Test/Extralazy/UserGroup.hbm.xml @@ -4,7 +4,7 @@ assembly="NHibernate.Test" namespace="NHibernate.Test.Extralazy"> - + diff --git a/src/NHibernate.Test/Linq/MethodCallTests.cs b/src/NHibernate.Test/Linq/MethodCallTests.cs index c330b0944da..05abb79c0af 100644 --- a/src/NHibernate.Test/Linq/MethodCallTests.cs +++ b/src/NHibernate.Test/Linq/MethodCallTests.cs @@ -47,6 +47,7 @@ public void CanExecuteCountWithOrderByArguments() public void CanSelectPropertiesIntoObjectArray() { var result = db.Users + .OrderBy(u => u.Id) .Select(u => new object[] {u.Id, u.Name, u.InvalidLoginAttempts}) .First(); @@ -59,6 +60,7 @@ public void CanSelectPropertiesIntoObjectArray() public void CanSelectComponentsIntoObjectArray() { var result = db.Users + .OrderBy(u => u.Id) .Select(u => new object[] {u.Component, u.Component.OtherComponent}) .First(); @@ -94,6 +96,7 @@ public void CanSelectConstantsIntoObjectArray() const string name = "Julian"; var result = db.Users + .OrderBy(u => u.Id) .Select(u => new object[] {u.Id, pi, name, DateTime.MinValue}) .First(); @@ -107,6 +110,7 @@ public void CanSelectConstantsIntoObjectArray() public void CanSelectPropertiesFromAssociationsIntoObjectArray() { var result = db.Users + .OrderBy(u => u.Id) .Select(u => new object[] {u.Id, u.Role.Name, u.Role.Entity.Output}) .First(); @@ -119,6 +123,7 @@ public void CanSelectPropertiesFromAssociationsIntoObjectArray() public void CanSelectPropertiesIntoObjectArrayInProperty() { var result = db.Users + .OrderBy(u => u.Id) .Select(u => new { Cells = new object[] { u.Id, u.Name, new object[u.Id] } }) .First(); @@ -132,6 +137,7 @@ public void CanSelectPropertiesIntoObjectArrayInProperty() public void CanSelectPropertiesIntoPropertyListInProperty() { var result = db.Users + .OrderBy(u => u.Id) .Select(u => new { Cells = new List { u.Id, u.Name, new object[u.Id] } }) .First(); @@ -144,7 +150,7 @@ public void CanSelectPropertiesIntoPropertyListInProperty() [Test, Description("NH-2744")] public void CanSelectPropertiesIntoNestedObjectArrays() { - var query = db.Users.Select(u => new object[] {"Root", new object[] {"Sub1", u.Name, new object[] {"Sub2", u.Name}}}); + var query = db.Users.OrderBy(u => u.Id).Select(u => new object[] {"Root", new object[] {"Sub1", u.Name, new object[] {"Sub2", u.Name}}}); var result = query.First(); Assert.That(result.Length, Is.EqualTo(2)); diff --git a/src/NHibernate.Test/NHSpecificTest/NH2113/Mappings.hbm.xml b/src/NHibernate.Test/NHSpecificTest/NH2113/Mappings.hbm.xml index 64151c2d8bc..d5e799d7c91 100644 --- a/src/NHibernate.Test/NHSpecificTest/NH2113/Mappings.hbm.xml +++ b/src/NHibernate.Test/NHSpecificTest/NH2113/Mappings.hbm.xml @@ -15,7 +15,7 @@ - + diff --git a/src/NHibernate.Test/NHSpecificTest/NH2907/Mappings.hbm.xml b/src/NHibernate.Test/NHSpecificTest/NH2907/Mappings.hbm.xml index bb35dc0ba6a..95c5fdeec3d 100644 --- a/src/NHibernate.Test/NHSpecificTest/NH2907/Mappings.hbm.xml +++ b/src/NHibernate.Test/NHSpecificTest/NH2907/Mappings.hbm.xml @@ -12,11 +12,11 @@ - + - \ No newline at end of file + diff --git a/src/NHibernate.Test/NHibernate.Test.csproj b/src/NHibernate.Test/NHibernate.Test.csproj index 80b7b5f6b24..e5e553f5b30 100644 --- a/src/NHibernate.Test/NHibernate.Test.csproj +++ b/src/NHibernate.Test/NHibernate.Test.csproj @@ -67,7 +67,7 @@ - + From 9613ffed1293c67d8927df5b1aa5022ee54300d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delaporte?= <12201973+fredericDelaporte@users.noreply.github.com> Date: Thu, 30 Nov 2023 20:36:55 +0100 Subject: [PATCH 4/4] Release 5.4.7 (#3459) --- build-common/NHibernate.props | 2 +- releasenotes.txt | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/build-common/NHibernate.props b/build-common/NHibernate.props index 7fd65db2f30..b36961fc58a 100644 --- a/build-common/NHibernate.props +++ b/build-common/NHibernate.props @@ -3,7 +3,7 @@ 5.4 - 6 + 7 9.0 diff --git a/releasenotes.txt b/releasenotes.txt index e08c3b4eb23..f9fbf217f26 100644 --- a/releasenotes.txt +++ b/releasenotes.txt @@ -1,4 +1,18 @@ -Build 5.4.6 +Build 5.4.7 +============================= + +Release notes - NHibernate - Version 5.4.7 + +3 issues were resolved in this release. + +** Task + + * #3459 Release 5.4.7 + * #3458 Merge 5.3.20 into 5.4.x + * #3453 Migrate appveyor build to MySql 8 + + +Build 5.4.6 ============================= Release notes - NHibernate - Version 5.4.6