Skip to content

Commit 6a49288

Browse files
If prepare_sql is enabled, ignore an incompatible test.
1 parent 7eec6eb commit 6a49288

File tree

1 file changed

+6
-2
lines changed
  • src/NHibernate.Test/NHSpecificTest/SqlConverterAndMultiQuery

1 file changed

+6
-2
lines changed

src/NHibernate.Test/NHSpecificTest/SqlConverterAndMultiQuery/Fixture.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using NHibernate.Cfg;
22
using NHibernate.Dialect;
3+
using NHibernate.Util;
34
using NUnit.Framework;
45

56
namespace NHibernate.Test.NHSpecificTest.SqlConverterAndMultiQuery
@@ -16,9 +17,12 @@ protected override void Configure(Configuration configuration)
1617

1718
protected override bool AppliesTo(Dialect.Dialect dialect)
1819
{
19-
// MsSqlCe throws InvalidOperationException instead of a DbException for these tests, preventing
20+
// If prepare_sql is enabled, with most databases prepare will fail with an InvalidOperationException,
21+
// turned into ADOException by prepare code and then not passed to the exception converter.
22+
// MsSqlCe throws InvalidOperationException during Prepare (even when disabled), preventing
2023
// the test SqlConverter to do its job.
21-
return !(Dialect is MsSqlCeDialect);
24+
var prepareSql = PropertiesHelper.GetBoolean(Environment.PrepareSql, cfg.Properties, false);
25+
return !(prepareSql || Dialect is MsSqlCeDialect);
2226
}
2327

2428
[Test]

0 commit comments

Comments
 (0)