Repository navigation
A numeric range filter on a JSON path no longer fails the whole query when
one row holds something that is not a number there.
Fixed
- JSON path
gt/gte/lt/ltewith a number, on PostgreSQL.
The path's value was cast with a plain::numeric, so a single row holding
text, a boolean, an object or an array at that path failed the query with
invalid input syntax for type numeric. A JSON column is schemaless, so one
stray value was enough. The cast now applies only to text the connected
PostgreSQL server reads as a number: a decimal with an optional fraction
and exponent,NaN, orInfinity/inf, with the ASCII white space the
numeric parser skips (a Unicode space such as U+2003 is not skipped by the
parser, so it is not here either). Any other value is NULL and that row does
not match. Numeric strings with digit separators (1_000) and the0x/
0o/0bprefixes keep comparing on PostgreSQL 16+, and are safely
skipped on PostgreSQL 14/15, where the numeric parser refuses them.
Ordering and aggregates withtype: 'numeric'are unchanged, since there
the caller declares the values numeric. Other engines are unchanged: their
float casts do not raise.