Skip to content

Commit 06d93bc

Browse files
David EllingsworthDavid Ellingsworth
David Ellingsworth
authored and
David Ellingsworth
committed
nhibernateGH-3530: The SAP SQL Anywhere driver does not support the DbDataReader.GetChar method, wrap it in the NoCharDbDataReader.
1 parent 64a1953 commit 06d93bc

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by AsyncGenerator.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
11+
using System.Data.Common;
12+
using NHibernate.AdoNet;
13+
14+
namespace NHibernate.Driver
15+
{
16+
using System.Threading.Tasks;
17+
using System.Threading;
18+
public partial class SapSQLAnywhere17Driver : ReflectionBasedDriver
19+
{
20+
21+
public override async Task<DbDataReader> ExecuteReaderAsync(DbCommand command, CancellationToken cancellationToken)
22+
{
23+
cancellationToken.ThrowIfCancellationRequested();
24+
var reader = await (command.ExecuteReaderAsync(cancellationToken)).ConfigureAwait(false);
25+
26+
return new NoCharDbDataReader(reader);
27+
}
28+
}
29+
}

src/NHibernate/Driver/SapSQLAnywhere17Driver.cs

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
namespace NHibernate.Driver
1+
using System.Data.Common;
2+
using NHibernate.AdoNet;
3+
4+
namespace NHibernate.Driver
25
{
3-
public class SapSQLAnywhere17Driver : ReflectionBasedDriver
6+
public partial class SapSQLAnywhere17Driver : ReflectionBasedDriver
47
{
58
public SapSQLAnywhere17Driver()
69
: base("Sap.Data.SQLAnywhere", "Sap.Data.SQLAnywhere.v4.5", "Sap.Data.SQLAnywhere.SAConnection", "Sap.Data.SQLAnywhere.SACommand")
@@ -14,5 +17,12 @@ public SapSQLAnywhere17Driver()
1417
public override string NamedPrefix => ":";
1518

1619
public override bool RequiresTimeSpanForTime => true;
20+
21+
public override DbDataReader ExecuteReader(DbCommand command)
22+
{
23+
var reader = command.ExecuteReader();
24+
25+
return new NoCharDbDataReader(reader);
26+
}
1727
}
1828
}

0 commit comments

Comments
 (0)