DataAction / AdoNetCore.AseClient

AdoNetCore.AseClient - a .NET Core DB Provider for SAP ASE
Apache License 2.0
108 stars 45 forks source link

[linq2db] AseDataReader returns decimal? type from GetFieldType(i) #49

Closed MaceWindu closed 6 years ago

MaceWindu commented 6 years ago

Query

SELECT TOP 1
    Convert(Decimal(29,10), @value1) as [c1]
FROM
    [LinqDataTypes] [t1]

parameter type is Decimal with value 6579.64648m

Native provider returns decimal type, managed provider returns decimal? type.

It is funny that it was discovered only becase we had bug in our code that didn't allowed us to process Nullable types properly in some cases.

linq2db test: ConvertTests.ConvertFromOneToAnother.LinqService

MaceWindu commented 6 years ago

Btw, fix in linq2db reduce number of test failed tests to 136 from 365 (I will retest fix for this issue without linq2db fix applied to be sure it was fixed)

MaceWindu commented 6 years ago

I cannot find it right now, but I suspect this method should allways return unwrapped type (as it is pre-nullable types API)

senseibaka commented 6 years ago

Yes, so it looks like the reference driver responds with the field's type, rather than the value's type. Kind of makes sense, considering the method is called GetFieldType, not GetValueType

MaceWindu commented 6 years ago

Fixed!