Skip to content

Commit f3031ae

Browse files
Fix DB2/400 schema generation on 5.3.x (#3451)
Co-authored-by: Roman Artiukhin <[email protected]>
1 parent 4dac4ca commit f3031ae

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/GenerateAsyncCode.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: |
2828
dotnet restore "./Tools/packages.csproj" --packages ./Tools
2929
pushd src
30-
dotnet restore ./NHibernate.sln
30+
dotnet restore ./NHibernate.sln /p:TreatWarningsAsErrors=false
3131
dotnet $(find ./../Tools/csharpasyncgenerator.commandline -name AsyncGenerator.CommandLine.dll)
3232
popd
3333

src/NHibernate/Dialect/DB2400Dialect.cs

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using NHibernate.Cfg;
1+
using System;
2+
using System.Data.Common;
3+
using NHibernate.Dialect.Schema;
24
using NHibernate.SqlCommand;
35

46
namespace NHibernate.Dialect
@@ -23,7 +25,13 @@ public class DB2400Dialect : DB2Dialect
2325
{
2426
public DB2400Dialect()
2527
{
26-
DefaultProperties[Environment.ConnectionDriver] = "NHibernate.Driver.DB2400Driver";
28+
DefaultProperties[Cfg.Environment.ConnectionDriver] = "NHibernate.Driver.DB2400Driver";
29+
}
30+
31+
public override IDataBaseSchema GetDataBaseSchema(DbConnection connection)
32+
{
33+
// The DB2 implementation is not valid for DB2400.
34+
throw new NotSupportedException();
2735
}
2836

2937
public override bool SupportsSequences
@@ -61,4 +69,4 @@ public override bool SupportsVariableLimit
6169
get { return false; }
6270
}
6371
}
64-
}
72+
}

0 commit comments

Comments
 (0)