Skip to content

WIP Add testing DB2 to GitHub Actions #2967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 51 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f9f7e3f
Add testing DB2 to GitHub Actions
bahusoid Dec 30, 2021
7c4f69f
DB2 dialect: Support str function
bahusoid Dec 30, 2021
c3b2344
Add DB2TestDialect
bahusoid Dec 31, 2021
6bd9390
SupportsNonDataBoundCondition false
hazzik Jan 1, 2022
93c32b4
SupportsSubSelectsInOrderBy false
hazzik Jan 1, 2022
83ce22b
Revert MySql condition
hazzik Jan 1, 2022
826962b
HasBrokenTypeInferenceOnSelectedParameters true
hazzik Jan 2, 2022
118bc45
SupportsHavingOnGroupedByComputation false
hazzik Jan 2, 2022
6009cf8
SupportsSelectForUpdateWithPaging false
hazzik Jan 2, 2022
c753a31
Simplifying exports for DB2
hazzik Jan 2, 2022
302238d
Add packages for all supported platforms.
hazzik Jan 2, 2022
15cd64a
Use 3.1.0.500 version of provider
hazzik Jan 10, 2022
c865c90
DB2 precision for decimal seems to be 0(?)
hazzik Jan 11, 2022
4d3f01b
DB2 reports int parameters with precision
hazzik Jan 11, 2022
93b2e39
Fix casing for column name
hazzik Jan 11, 2022
820f80d
Skip native guid tests for DB2
hazzik Jan 11, 2022
6b4dffe
Register truncate function for DB2
hazzik Sep 17, 2020
9023722
Fix tests wit multi-table delete
hazzik Jan 11, 2022
b5b5898
Add QuerySequencesString
hazzik Jan 12, 2022
1545478
Register replace function
hazzik Jan 12, 2022
6b2d38d
Register reserved keywords
hazzik Jan 17, 2022
aa6f639
Move exports to DB_INIT
bahusoid Feb 24, 2023
759e8d5
Use latest docker db2:11.5.8.0
bahusoid Feb 24, 2023
aa2aae3
Use .NET6/7 version of provider
hazzik May 19, 2023
f48971a
Ignore MSB3270 for AsyncGenerator
hazzik May 19, 2023
8d97e58
Add new driver for Net5.IBM.Data.Db2/Net.IBM.Data.Db2 DataProvider
hazzik May 19, 2023
711c467
Update NHibernate.Test.csproj
hazzik Jun 4, 2024
ff87530
use 11.5.9 & net8
hazzik Jun 4, 2024
444af31
Set SupportsCancelQuery to false
hazzik Jun 4, 2024
1bfb064
DB2NetDriver should be same as DB2CoreDriver
hazzik Jun 4, 2024
578bf11
DB2 has "id" as a reserved keyword :-/
hazzik Jun 5, 2024
0992437
Fix ignoring test
hazzik Jun 5, 2024
2efe2dc
Generate async files
github-actions[bot] Jun 5, 2024
fbc3ea8
Add new DB2NetDriver and obsolete DB2CoreDriver
hazzik Jun 5, 2024
906e790
Merge branch 'master' of https://github.com/nhibernate/nhibernate-cor…
hazzik Jun 5, 2024
9c11a74
Merge branch 'db2netdriver' into db2
hazzik Jun 5, 2024
c59038a
Merge branch 'db2' of https://github.com/bahusoid/nhibernate-core int…
hazzik Jun 5, 2024
c41ec23
Fix package name
hazzik Jun 5, 2024
49c5028
Register "strguid" function
hazzik Jun 5, 2024
e0bd019
Register some math functions
hazzik Jun 5, 2024
ad17752
Register some string functions
hazzik Jun 5, 2024
b13300e
Register nvl & iif functions
hazzik Jun 5, 2024
5652d82
fixup! Register some string functions
hazzik Jun 5, 2024
b685dab
Generate async files
github-actions[bot] Jun 5, 2024
1454c2b
DB2 does not support sequence identity
hazzik Jun 5, 2024
2f715c2
Register atan2 function
hazzik Jun 5, 2024
b989fb4
Add support for temporary tables
hazzik Jun 5, 2024
ac836a5
Generate async files
github-actions[bot] Jun 5, 2024
2bf59b4
DB2 supports union all
hazzik Jun 6, 2024
cae7a56
Update reserved words list based on documentation
hazzik Jun 6, 2024
2f972b9
Revert "DB2 has "id" as a reserved keyword :-/"
hazzik Jun 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/NetCoreTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ jobs:
DB_INIT: |
docker run -d -p 1521:1521 -e APP_USER=nhibernate -e APP_USER_PASSWORD=nhibernate -e ORACLE_PASSWORD=nhibernate gvenzl/oracle-xe:21-slim
- DB: SQLite
- DB: DB2
CONNECTION_STRING: "Server=localhost:50000;Database=nhib;UID=nhib;PWD=nhib;"
DB_INIT: |
docker run --name DB2 --privileged=true -e DB2INSTANCE=nhib -e DB2INST1_PASSWORD=nhib -e DBNAME=nhib -e LICENSE=accept -e AUTOCONFIG=false -e ARCHIVE_LOGS=false -p 50000:50000 -d icr.io/db2_community/db2:11.5.9.0
docker logs -f DB2 | sed '/(*) Setup has completed./ q'
docker exec DB2 su - nhib bash -c "db2 connect to nhib; db2 CREATE USER TEMPORARY TABLESPACE TEMPSPACE_32"

DB2_CLI_DRIVER_INSTALL_PATH="$(pwd)/src/NHibernate.Test/bin/Release/net8.0/clidriver"
echo "DB2LANG=en_US" >> $GITHUB_ENV
echo "DB2_CLI_DRIVER_INSTALL_PATH=$DB2_CLI_DRIVER_INSTALL_PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DB2_CLI_DRIVER_INSTALL_PATH/lib" >> $GITHUB_ENV
echo "LIBPATH=$LIBPATH:$DB2_CLI_DRIVER_INSTALL_PATH/lib" >> $GITHUB_ENV
echo "PATH=$DB2_CLI_DRIVER_INSTALL_PATH/bin:$DB2_CLI_DRIVER_INSTALL_PATH/adm:$PATH" >> $GITHUB_ENV

runs-on: ubuntu-latest
continue-on-error: ${{matrix.ALLOW_FAILURE == true}}
env:
Expand Down
5 changes: 5 additions & 0 deletions psake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ Task Set-Configuration {
'connection.connection_string' = 'User ID=nhibernate;Password=nhibernate;Metadata Pooling=false;Self Tuning=false;Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XEPDB1)))';
'connection.driver_class' = 'NHibernate.Driver.OracleManagedDataClientDriver';
'dialect' = 'NHibernate.Dialect.Oracle10gDialect'
};
'DB2' = @{
'connection.connection_string' = '';
'dialect' = 'NHibernate.Dialect.DB2Dialect';
'connection.driver_class' = 'NHibernate.Driver.DB2NetDriver'
}
}
#Settings for current build
Expand Down
1 change: 1 addition & 0 deletions src/AsyncGenerator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@
applyChanges: true
suppressDiagnosticFailures:
- pattern: ^.*(Hql\.g).*$
- pattern: IBM.Data.Db2.dll
analyzation:
methodConversion:
- conversion: Ignore
Expand Down
4 changes: 2 additions & 2 deletions src/NHibernate.Test/Async/CacheTest/QueryCacheFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ public async Task QueryCacheWithScalarReturnAsync()
using (var s = OpenSession())
{
var result = await (s
.CreateSQLQuery("select cast(200012 as decimal) from Simple where id_ = 1")
.CreateSQLQuery("select cast(200012 as DECIMAL(18,5)) from Simple where id_ = 1")
.SetCacheable(true)
.UniqueResultAsync<decimal>());

Assert.That(result, Is.EqualTo(200012), "Unexpected non-cached result");

result = await (s
.CreateSQLQuery("select cast(200012 as decimal) from Simple where id_ = 1")
.CreateSQLQuery("select cast(200012 as DECIMAL(18,5)) from Simple where id_ = 1")
.SetCacheable(true)
.UniqueResultAsync<decimal>());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ public async Task SubQueryAsync()
[Test]
public async Task ThreeLevelSubqueryAsync()
{
if (!Dialect.SupportsScalarSubSelects)
Assert.Ignore("Dialect does not support scalar sub-select");
if (!TestDialect.SupportsSubSelectsInOrderBy)
Assert.Ignore("Dialect does not support order by sub-select");

Person p = null;
var detachedCriteria2 = DetachedCriteria.For<Person>("vf_inner_2")
Expand Down
7 changes: 6 additions & 1 deletion src/NHibernate.Test/Async/Futures/FutureQueryFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,12 @@ public async Task CanExecuteMultipleQueryWithSameParameterNameAsync()
string paramPrefix = ((DriverBase) Sfi.ConnectionProvider.Driver).NamedPrefix;
Assert.That(
wholeLog,
Does.Contain(paramPrefix + "p0 = 1 [Type: Int32 (0:0:0)], " + paramPrefix + "p1 = 2 [Type: Int32 (0:0:0)]"));
Does.Contain(
paramPrefix + "p0 = 1 [Type: Int32 (0:0:0)], " +
paramPrefix + "p1 = 2 [Type: Int32 (0:0:0)]")
.Or.Contain(
paramPrefix + "p0 = 1 [Type: Int32 (4:0:0)], " +
paramPrefix + "p1 = 2 [Type: Int32 (4:0:0)]"));
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/NHibernate.Test/Async/Futures/LinqFutureFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,12 @@ public async Task CanExecuteMultipleQueriesOnSameExpressionAsync()
string paramPrefix = ((DriverBase) Sfi.ConnectionProvider.Driver).NamedPrefix;
Assert.That(
wholeLog,
Does.Contain(paramPrefix + "p0 = 1 [Type: Int32 (0:0:0)], " + paramPrefix + "p1 = 2 [Type: Int32 (0:0:0)]"));
Does.Contain(
paramPrefix + "p0 = 1 [Type: Int32 (0:0:0)], " +
paramPrefix + "p1 = 2 [Type: Int32 (0:0:0)]")
.Or.Contain(
paramPrefix + "p0 = 1 [Type: Int32 (4:0:0)], " +
paramPrefix + "p1 = 2 [Type: Int32 (4:0:0)]"));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ protected override bool AppliesTo(Dialect.Dialect dialect)
// SAP HANA does not support a syntax allowing to return the inserted id as an output parameter or a return value
!(dialect is Dialect.HanaDialectBase) &&
// SQL Anywhere does not support a syntax allowing to return the inserted id as an output parameter or a return value
!(dialect is Dialect.SybaseSQLAnywhere10Dialect);
!(dialect is Dialect.SybaseSQLAnywhere10Dialect) &&
!(dialect is Dialect.DB2Dialect);
}

[Test]
Expand Down
16 changes: 15 additions & 1 deletion src/NHibernate.Test/Async/IdGen/NativeGuid/NativeGuidFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
//------------------------------------------------------------------------------


using System;
using System.Collections;
using NUnit.Framework;

Expand All @@ -27,6 +28,19 @@ protected override string[] Mappings
get { return new[] {"IdGen.NativeGuid.NativeGuidPoid.hbm.xml"}; }
}

protected override bool AppliesTo(Dialect.Dialect dialect)
{
try
{
var _ = dialect.SelectGUIDString;
return true;
}
catch (NotSupportedException)
{
return false;
}
}

[Test]
public async Task CrdAsync()
{
Expand All @@ -51,4 +65,4 @@ public async Task CrdAsync()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async Task ReturnedValueIsGuidAsync()
{
try
{
var str = Dialect.Dialect.GetDialect().SelectGUIDString;
var _ = sessions.Dialect.SelectGUIDString;
}
catch (NotSupportedException)
{
Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate.Test/Async/Legacy/FooBarTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ public async Task QueryAsync()
{
await (s.CreateQuery("from foo in class Foo where lower( foo.TheFoo.String ) = 'foo'").ListAsync());
await (s.CreateQuery("from foo in class Foo where lower( (foo.TheFoo.String || 'foo') || 'bar' ) = 'foo'").ListAsync());
await (s.CreateQuery("from foo in class Foo where repeat( (foo.TheFoo.STring || 'foo') || 'bar', 2 ) = 'foo'").ListAsync());
await (s.CreateQuery("from foo in class Foo where repeat( (foo.TheFoo.String || 'foo') || 'bar', 2 ) = 'foo'").ListAsync());
await (s.CreateQuery(
"From foo in class Bar where foo.TheFoo.Integer is not null and repeat( (foo.TheFoo.String || 'foo') || 'bar', (5+5)/2 ) = 'foo'")
.ListAsync());
Expand Down
4 changes: 2 additions & 2 deletions src/NHibernate.Test/Async/Linq/WhereSubqueryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ public async Task OrdersWithSubquery11Async()
{
if (Dialect is MySQLDialect)
Assert.Ignore("MySQL does not support LIMIT in subqueries.");
if (Dialect is MsSqlCeDialect)
Assert.Ignore("MS SQL CE does not support sorting on a subquery.");
if (!TestDialect.SupportsSubSelectsInOrderBy)
Assert.Ignore("Dialect does not support order by sub-select");

var ordersQuery = db.Orders
.OrderByDescending(x => x.OrderLines.Count).ThenBy(x => x.OrderId)
Expand Down
10 changes: 9 additions & 1 deletion src/NHibernate.Test/Async/NHSpecificTest/GH1921/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ protected override void OnTearDown()
using (var session = OpenSession())
using (var transaction = session.BeginTransaction())
{
session.CreateQuery("delete from System.Object").ExecuteUpdate();
session.CreateQuery("delete from Entity").ExecuteUpdate();
// Some dialects don't support multi-table deletes, so delete via in memory loading
session.Delete("from MultiTableEntity");

transaction.Commit();
}
Expand Down Expand Up @@ -142,6 +144,9 @@ public async Task MultiTableDmlInsertAsync(string filter)
[TestCase("OtherNameFilter")]
public async Task MultiTableDmlUpdateAsync(string filter)
{
if (!Dialect.SupportsTemporaryTables)
Assert.Ignore("Dialect does not support multi-table update");

var isFiltered = !string.IsNullOrEmpty(filter);

using (var session = OpenSession())
Expand Down Expand Up @@ -180,6 +185,9 @@ public async Task MultiTableDmlUpdateAsync(string filter)
[TestCase("OtherNameFilter")]
public async Task MultiTableDmlDeleteAsync(string filter)
{
if (!Dialect.SupportsTemporaryTables)
Assert.Ignore("Dialect does not support multi-table delete");

var isFiltered = !string.IsNullOrEmpty(filter);

using (var session = OpenSession())
Expand Down
15 changes: 12 additions & 3 deletions src/NHibernate.Test/Async/NHSpecificTest/Logs/LogsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ public async Task WillGetSessionIdFromConsecutiveSessionsLogsAsync()
for (var j = 0; j < 10; j++)
{
var sessionId = sessions[j].GetSessionImplementation().SessionId;
Assert.That(loggingEvent, Does.Contain($"p0 = {i * 10 + j} [Type: Int32 (0:0:0)] | SessionId: {sessionId}"));
Assert.That(
loggingEvent,
Does.Contain($"p0 = {i * 10 + j} [Type: Int32 (0:0:0)] | SessionId: {sessionId}")
.Or.Contain($"p0 = {i * 10 + j} [Type: Int32 (4:0:0)] | SessionId: {sessionId}"));
}
}
}
Expand All @@ -138,7 +141,10 @@ public async Task WillGetSessionIdFromInterlacedSessionsLogsAsync()
for (var i = 0; i < interceptor.SessionIds.Count; i++)
{
var sessionId = interceptor.SessionIds[i];
Assert.That(loggingEvent, Does.Contain($"p0 = {i + 1} [Type: Int32 (0:0:0)] | SessionId: {sessionId}"));
Assert.That(
loggingEvent,
Does.Contain($"p0 = {i + 1} [Type: Int32 (0:0:0)] | SessionId: {sessionId}")
.Or.Contain(($"p0 = {i + 1} [Type: Int32 (4:0:0)] | SessionId: {sessionId}")));
}
Assert.That(loggingEvent, Does.Contain($"Person person0_ | SessionId: {s.GetSessionImplementation().SessionId}"));
}
Expand Down Expand Up @@ -205,7 +211,10 @@ public async Task WillGetSessionIdFromSessionLogsConcurrentAsync()
for (var j = 0; j < 10; j++)
{
var sessionId = sessionIds[i];
Assert.That(loggingEvent, Does.Contain($"p0 = {i * 10 + j} [Type: Int32 (0:0:0)] | SessionId: {sessionId}"));
Assert.That(
loggingEvent,
Does.Contain($"p0 = {i * 10 + j} [Type: Int32 (0:0:0)] | SessionId: {sessionId}")
.Or.Contain($"p0 = {i * 10 + j} [Type: Int32 (4:0:0)] | SessionId: {sessionId}"));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,8 @@ public async Task NestedSubqueriesShouldStayInOrderAsync()
[Test]
public async Task SubstringShouldUseAllParametersAsync()
{
// https://technet.microsoft.com/en-us/library/ms174077(v=sql.110).aspx
if (Dialect is MsSqlCeDialect)
Assert.Ignore("Sql function left not supported by MS SQL CE");
if (!Dialect.Functions.ContainsKey("left"))
Assert.Ignore($"Sql function left not is supported by {Dialect}");

using (ISession s = OpenSession())
using (ITransaction tx = s.BeginTransaction())
Expand Down
4 changes: 2 additions & 2 deletions src/NHibernate.Test/Async/NHSpecificTest/NH3426/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public async Task SelectGuidToStringImplicitAsync()
if (Dialect is SQLiteDialect && _useBinaryGuid)
Assert.Ignore("Fails with BinaryGuid=True due to GH-2109. (2019-04-09).");

if (Dialect is FirebirdDialect || Dialect is MySQLDialect || Dialect is Oracle8iDialect)
if (Dialect is FirebirdDialect or MySQLDialect || Dialect is Oracle8iDialect || Dialect is DB2Dialect)
Assert.Ignore("Since strguid() is not applied, it fails on Firebird, MySQL and Oracle " +
"because a simple cast cannot be used for GUID to string conversion on " +
"these dialects. See GH-2109.");
Expand All @@ -184,7 +184,7 @@ public async Task WhereGuidToStringImplicitAsync()
if (Dialect is SQLiteDialect && _useBinaryGuid)
Assert.Ignore("Fails with BinaryGuid=True due to GH-2109. (2019-04-09).");

if (Dialect is FirebirdDialect || Dialect is MySQLDialect || Dialect is Oracle8iDialect)
if (Dialect is FirebirdDialect || Dialect is MySQLDialect || Dialect is Oracle8iDialect || Dialect is DB2Dialect)
Assert.Ignore("Since strguid() is not applied, it fails on Firebird, MySQL and Oracle " +
"because a simple cast cannot be used for GUID to string conversion on " +
"these dialects. See GH-2109.");
Expand Down
8 changes: 4 additions & 4 deletions src/NHibernate.Test/Async/ProjectionFixtures/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public async Task AggregatingHirearchyWithCountAsync()
[Test]
public async Task LimitingResultSetOnQueryThatIsOrderedByProjectionAsync()
{
if (!Dialect.SupportsScalarSubSelects)
Assert.Ignore("Dialect does not support scalar sub-select");
if (!TestDialect.SupportsSubSelectsInOrderBy)
Assert.Ignore("Dialect does not support order by sub-select");

using(var s = OpenSession())
{
Expand All @@ -172,8 +172,8 @@ public async Task LimitingResultSetOnQueryThatIsOrderedByProjectionAsync()
[Test]
public async Task QueryingWithParemetersAndParaemtersInOrderByAsync()
{
if (!Dialect.SupportsScalarSubSelects)
Assert.Ignore("Dialect does not support scalar sub-select");
if (!TestDialect.SupportsSubSelectsInOrderBy)
Assert.Ignore("Dialect does not support order by sub-select");

using (var s = OpenSession())
{
Expand Down
4 changes: 2 additions & 2 deletions src/NHibernate.Test/CacheTest/QueryCacheFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ public void QueryCacheWithScalarReturn()
using (var s = OpenSession())
{
var result = s
.CreateSQLQuery("select cast(200012 as decimal) from Simple where id_ = 1")
.CreateSQLQuery("select cast(200012 as DECIMAL(18,5)) from Simple where id_ = 1")
.SetCacheable(true)
.UniqueResult<decimal>();

Assert.That(result, Is.EqualTo(200012), "Unexpected non-cached result");

result = s
.CreateSQLQuery("select cast(200012 as decimal) from Simple where id_ = 1")
.CreateSQLQuery("select cast(200012 as DECIMAL(18,5)) from Simple where id_ = 1")
.SetCacheable(true)
.UniqueResult<decimal>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ public void SubQuery()
[Test]
public void ThreeLevelSubquery()
{
if (!Dialect.SupportsScalarSubSelects)
Assert.Ignore("Dialect does not support scalar sub-select");
if (!TestDialect.SupportsSubSelectsInOrderBy)
Assert.Ignore("Dialect does not support order by sub-select");

Person p = null;
var detachedCriteria2 = DetachedCriteria.For<Person>("vf_inner_2")
Expand Down
7 changes: 6 additions & 1 deletion src/NHibernate.Test/Futures/FutureQueryFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ public void CanExecuteMultipleQueryWithSameParameterName()
string paramPrefix = ((DriverBase) Sfi.ConnectionProvider.Driver).NamedPrefix;
Assert.That(
wholeLog,
Does.Contain(paramPrefix + "p0 = 1 [Type: Int32 (0:0:0)], " + paramPrefix + "p1 = 2 [Type: Int32 (0:0:0)]"));
Does.Contain(
paramPrefix + "p0 = 1 [Type: Int32 (0:0:0)], " +
paramPrefix + "p1 = 2 [Type: Int32 (0:0:0)]")
.Or.Contain(
paramPrefix + "p0 = 1 [Type: Int32 (4:0:0)], " +
paramPrefix + "p1 = 2 [Type: Int32 (4:0:0)]"));
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/NHibernate.Test/Futures/LinqFutureFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,12 @@ public void CanExecuteMultipleQueriesOnSameExpression()
string paramPrefix = ((DriverBase) Sfi.ConnectionProvider.Driver).NamedPrefix;
Assert.That(
wholeLog,
Does.Contain(paramPrefix + "p0 = 1 [Type: Int32 (0:0:0)], " + paramPrefix + "p1 = 2 [Type: Int32 (0:0:0)]"));
Does.Contain(
paramPrefix + "p0 = 1 [Type: Int32 (0:0:0)], " +
paramPrefix + "p1 = 2 [Type: Int32 (0:0:0)]")
.Or.Contain(
paramPrefix + "p0 = 1 [Type: Int32 (4:0:0)], " +
paramPrefix + "p1 = 2 [Type: Int32 (4:0:0)]"));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ protected override bool AppliesTo(Dialect.Dialect dialect)
// SAP HANA does not support a syntax allowing to return the inserted id as an output parameter or a return value
!(dialect is Dialect.HanaDialectBase) &&
// SQL Anywhere does not support a syntax allowing to return the inserted id as an output parameter or a return value
!(dialect is Dialect.SybaseSQLAnywhere10Dialect);
!(dialect is Dialect.SybaseSQLAnywhere10Dialect) &&
!(dialect is Dialect.DB2Dialect);
}

[Test]
Expand Down
16 changes: 15 additions & 1 deletion src/NHibernate.Test/IdGen/NativeGuid/NativeGuidFixture.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections;
using NUnit.Framework;

Expand All @@ -16,6 +17,19 @@ protected override string[] Mappings
get { return new[] {"IdGen.NativeGuid.NativeGuidPoid.hbm.xml"}; }
}

protected override bool AppliesTo(Dialect.Dialect dialect)
{
try
{
var _ = dialect.SelectGUIDString;
return true;
}
catch (NotSupportedException)
{
return false;
}
}

[Test]
public void Crd()
{
Expand All @@ -40,4 +54,4 @@ public void Crd()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void ReturnedValueIsGuid()
{
try
{
var str = Dialect.Dialect.GetDialect().SelectGUIDString;
var _ = sessions.Dialect.SelectGUIDString;
}
catch (NotSupportedException)
{
Expand Down
Loading
Loading