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
Substitution of parameters ($1, $2, ...) to prepared queries fails. E.g. for Int value 10 it fails with error message «server: invalid byte sequence for encoding "UTF8": 0x00 (report_invalid_encoding)». I guess the problem is that format (text or binary) is incorrect. The same for unprepared queries works fine.
Decoding of values fails too. Simple SELECT 10 as prepared query can't decode the result as Int, but decodes it as Data of 4 bytes (0x00, 0x00, 0x00, 0x0A). In this case the problem is in «Int+PostgresCodable.swift:254» converting "\0\0\0\10" string to Int. But if format of the received cells is changed to .binary before decoding then values are successfully decoded.
Describe the bug
Substitution of parameters ($1, $2, ...) to prepared queries fails. E.g. for
Int
value 10 it fails with error message «server: invalid byte sequence for encoding "UTF8": 0x00 (report_invalid_encoding)». I guess the problem is that format (text or binary) is incorrect. The same for unprepared queries works fine.Decoding of values fails too. Simple
SELECT 10
as prepared query can't decode the result asInt
, but decodes it asData
of 4 bytes (0x00, 0x00, 0x00, 0x0A). In this case the problem is in «Int+PostgresCodable.swift:254» converting "\0\0\0\10" string toInt
. But if format of the received cells is changed to.binary
before decoding then values are successfully decoded.To Reproduce
That's Xcode tests:
Steps to reproduce the behavior:
testSelectPlainPrepared()
andtestSelectFormattedPrepared()
.testSelectPlainPreparedBinary()
.Expected behavior
Correct encoding and decoding of values for prepared queries.
Environment
The text was updated successfully, but these errors were encountered: