Gateway raw reads return a stored NULL as value 0 (SQL backends return null) #690
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the #685–#688 live AVEVA gate (2026-10-12), pre-existing.
A stored NULL sample inside the window comes back from Gateway HistoryRead-Raw as value
0with a Bad status (histsdk puts a value on every row; a NULL row is value 0 + Bad OPC quality). The SqlServer and QuestDB backends return a null value with the Bad status. Clients that read the value without checking the status see a fabricated 0.Suggested fix: in
SampleMapper.ToSnapshots, null the value when the OPC quality is Bad (as the aggregate mapper already does for no-data rows), and pin it with a wire-shaped fake.Fixed on master
15ccd9b7(mergef0d064a6):SampleMapper.ToSnapshotnulls the value whenever the mapped status is Bad (AVEVA stores a Bad sample as NULL; Uncertain keeps its value). Applies to raw and AtTime; per-sample aggregates were already correct.Live AVEVA gate PASS: a stored NULL returns null + Bad in raw, reverse, bounded and AtTime reads. (AtTime has separate interpolation issues — #693.)