-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding an array of composite types fails with a segmentation fault #620
Comments
This could cause a segfault. Fixes #620
Setting dimensions is especially useful, when a Record shall be encoded into an Array, since the Array encoder can not distinguish if the array shall be encoded as a higher dimension or as a record otherwise. Related to #620
Setting dimensions is especially useful, when a Record shall be encoded into an Array, since the Array encoder can not distinguish if the array shall be encoded as a higher dimension or as a record otherwise. Related to #620
This could cause a segfault. Fixes #620
Thanks for fixing this so quickly! |
Your intention seems to be to encode a record into an array. This doesn't work so far, but I implemented #622 to make it possible. The array must be set to 1 dimension: array_encoder = PG::TextEncoder::Array.new(elements_type: record_encoder, dimensions: 1) |
Yup, that seemed like a sensible workaround. For my use case I wanted to build up a record encoder and decoder dynamically for a nested graph of composite types. The decoder worked but then when I tried to re-encode the output I ran into this issue. My use case only allows for arrays of records or primitives, not arrays of arrays, so I can just specify |
Environment:
Isolated Example:
Log Output:
log.txt
The text was updated successfully, but these errors were encountered: