Problem
FetchRecordsQuery::GetColumnValue (src/queries.cc) formats floating-point columns via std::to_wstring(sqlite3_column_double(stmt_, col)). std::to_wstring(double) uses %f with a fixed 6 decimal places.
Impact
Reads are lossy:
0.123456789 round-trips back as 0.123457.
- Large magnitudes and values needing scientific notation are mangled.
Writes are fine — binding uses sqlite3_bind_double with the true value — so the corruption happens only on the read path, through the text round-trip.
Suggested direction
Read doubles directly into the member with sqlite3_column_double (preferred — see the broader hydration redesign), or, if the text representation is kept, format with full round-trip precision (e.g. %.17g) rather than to_wstring. Add a test asserting a high-precision double round-trips exactly.
Problem
FetchRecordsQuery::GetColumnValue(src/queries.cc) formats floating-point columns viastd::to_wstring(sqlite3_column_double(stmt_, col)).std::to_wstring(double)uses%fwith a fixed 6 decimal places.Impact
Reads are lossy:
0.123456789round-trips back as0.123457.Writes are fine — binding uses
sqlite3_bind_doublewith the true value — so the corruption happens only on the read path, through the text round-trip.Suggested direction
Read doubles directly into the member with
sqlite3_column_double(preferred — see the broader hydration redesign), or, if the text representation is kept, format with full round-trip precision (e.g.%.17g) rather thanto_wstring. Add a test asserting a high-precision double round-trips exactly.