View Ticket
Not logged in
Ticket UUID: b0a5990f48ea830c075c6ea4f8b499145225d329
Title: C# Datatype Double range not fully supported
Status: Closed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Db_Type_Conversion Resolution: Fixed
Last Modified: 2011-07-07 04:35:32
Version Found In:
I wrote my own ORM library and tested all basic C# data types from all integer types up to all real types with System.Data.SQLite.

It turnes out that real number values using the C# type "Double" are correctly supported and mapped if its value is inside the range "Single.MinValue" to "Single.MinValue". But the desired range of "Double.MinValue" to "Double.MinValue" is not driven correctly. The values occur as infinite.

My same library detects proper work with the "Devart SQLite Provider docConnect" which lets me follow that "System.Data.SQLite.dll" and/or "SQLite.Interop.dll" limits the real value range in the "Single"-type area instead of the "Double"-type area even though SQLite itself can do real values with the huge range. It is at least an issue of reading the DB. May be of writing also.

The problem is important for applications dealing with Currency values mapped to C# Double type where Single does not support a sufficient mantissa.

By the way: C# "Decimal" type is not feasible with native SQLlite so this support is not feasible and no substitution.

Kind regards efef

anonymous added on 2011-05-25 07:46:24 UTC:
no subject since System.Data.Sqlite supports DOUBLE and REAL appropriate

anonymous added on 2011-05-29 08:08:51 UTC:
When you declare a table column as NUMERIC, DECIMAL, MONEY or CURRENCY, System.Data.SQLite maps that column as DbType.Decimal. Furthermore, there is no precission loss, since the data is stored as a string from version - August 11, 2008

mistachkin added on 2011-07-05 07:50:13 UTC:
Fixed by [eb6a22a1a9]. For tests, see [2a2aa7392c].