You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apparently, Postgres encodes NULL values inside arrays in a way that PostgreSQLDataDecoder does not anticipate. In this case, the byte count of the value is -1, which causes this line called from here to explode with a friendly error:
Fatal error: Can't form Range with upperBound < lowerBound
While this originally was discovered by using the array_agg function combined with left joins (which triggers this weird behavior), there is a much simpler reproduction:
conn.raw("SELECT ARRAY[NULL, 'foo', NULL, 'bar'] AS arr").all(decoding:SimpleArray.self)
where SimpleArray is defined as:
structSimpleArray:Decodable{letarr:[String?]}
The issue was discovered with Vapor 3 / Postgres (driver) 1.4.1.
V4 doesn't seem to be affected as array decoding is not implemented at all at the time of writing.
The text was updated successfully, but these errors were encountered:
Apparently, Postgres encodes NULL values inside arrays in a way that PostgreSQLDataDecoder does not anticipate. In this case, the byte
count
of the value is -1, which causes this line called from here to explode with a friendly error:While this originally was discovered by using the
array_agg
function combined with left joins (which triggers this weird behavior), there is a much simpler reproduction:where SimpleArray is defined as:
The issue was discovered with Vapor 3 / Postgres (driver) 1.4.1.
V4 doesn't seem to be affected as array decoding is not implemented at all at the time of writing.
The text was updated successfully, but these errors were encountered: