Bug #3446
closedWt::Dbo: NaN values of double throw exception for Sqlite
0%
Description
When using the Sqlite backend for Wt::Dbo, I get the following error when trying to input NaN values of a double:
exception: Sqlite3: insert into "rowname" ("version", "raw_id", "msg_type", "data_type", "key", "moosmsg_id", "moosmsg_time", "double_value", "string_value", "source", "source_auxiliary", "originating_community") values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?): NOT NULL constraint failed: rowname.double_value
This appears to be because Sqlite treats NaN as NULL, and the double implementation of Wt::Dbo::sql_value_traits sets NOT NULL on the table row. Perhaps Wt::Dbo::sql_value_traits for double should allow NULL and convert them to NaN on read?
Updated by Koen Deforche about 10 years ago
- Status changed from New to InProgress
- Assignee set to Korneel Dumon
- Target version set to 3.3.4
Updated by Koen Deforche about 10 years ago
- Assignee changed from Korneel Dumon to Koen Deforche
Updated by Koen Deforche about 10 years ago
- Status changed from InProgress to Resolved
We've fixed this by storing NaN as "NaN" string (Sqlite3 doesn't actually enforce data types so this comes in hand here).
Updated by Koen Deforche about 10 years ago
- Status changed from Resolved to Closed