Project

General

Profile

Bug #3446

Wt::Dbo: NaN values of double throw exception for Sqlite

Added by Anonymous about 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
07/09/2014
Due date:
% Done:

0%

Estimated time:

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?

#1

Updated by Koen Deforche almost 8 years ago

  • Status changed from New to InProgress
  • Assignee set to Korneel Dumon
  • Target version set to 3.3.4
#2

Updated by Koen Deforche almost 8 years ago

  • Assignee changed from Korneel Dumon to Koen Deforche
#3

Updated by Koen Deforche almost 8 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).

#4

Updated by Koen Deforche almost 8 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF