Project

General

Profile

Actions

Bug #3446

closed

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

Added by Anonymous over 10 years ago. Updated about 10 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?

Actions #1

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
Actions #2

Updated by Koen Deforche about 10 years ago

  • Assignee changed from Korneel Dumon to Koen Deforche
Actions #3

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).

Actions #4

Updated by Koen Deforche about 10 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF