Skip to content

Fix wide JSON foreign tables returning NULL for most columns - #56

Open
roseduan wants to merge 1 commit into
adjust:masterfrom
roseduan:fix_json_get_json_name
Open

Fix wide JSON foreign tables returning NULL for most columns#56
roseduan wants to merge 1 commit into
adjust:masterfrom
roseduan:fix_json_get_json_name

Conversation

@roseduan

Copy link
Copy Markdown

getJsonAttname() returned an interior pointer into the shared, growable attname_buf StringInfo. With many/long JSON keys the buffer is repalloc'd and relocated, leaving the pointers already stored in attnames[] dangling, so all but the last few columns silently decode to NULL.

Return a pstrdup'd copy of each key instead, and drop the now-unused attname_buf field and StringInfo parameter.

getJsonAttname() returned an interior pointer into the shared, growable
attname_buf StringInfo. With many/long JSON keys the buffer is repalloc'd
and relocated, leaving the pointers already stored in attnames[] dangling,
so all but the last few columns silently decode to NULL.

Return a pstrdup'd copy of each key instead, and drop the now-unused
attname_buf field and StringInfo parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant