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
Describe the bug
When scanning into a field of type easyjson.RawMessage, random binary data from memory is sometimes added to the start of the buffer.
The underlying type of easyjson.RawMessage is a []byte. I have multiple queries which return JSONB data that I then marshal into a struct field of type easyjson.RawMessage. This worked fine in v4 of the package.
Expected behavior
After upgrading to v5, the code would still work.
Actual behavior
After upgrading to v5, marshalling into a field of type easyjson.RawMessage results in random bytes from memory being appended to the start of the buffer most of the time. If I define a temporary variable of type []byte, scan into that and then assign that variable to the struct field the data is marshalled correctly.
Version
Go: go version go1.19.3 darwin/arm64
PostgreSQL: PostgreSQL 14.4 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 11.2.1_git20220219) 11.2.1 20220219, 64-bit
pgx: v5.2.0
The text was updated successfully, but these errors were encountered:
Describe the bug
When scanning into a field of type easyjson.RawMessage, random binary data from memory is sometimes added to the start of the buffer.
The underlying type of easyjson.RawMessage is a []byte. I have multiple queries which return JSONB data that I then marshal into a struct field of type easyjson.RawMessage. This worked fine in v4 of the package.
Expected behavior
After upgrading to v5, the code would still work.
Actual behavior
After upgrading to v5, marshalling into a field of type easyjson.RawMessage results in random bytes from memory being appended to the start of the buffer most of the time. If I define a temporary variable of type []byte, scan into that and then assign that variable to the struct field the data is marshalled correctly.
Version
go version go1.19.3 darwin/arm64
PostgreSQL 14.4 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 11.2.1_git20220219) 11.2.1 20220219, 64-bit
v5.2.0
The text was updated successfully, but these errors were encountered: