Skip to content

Conversation

mattrobenolt
Copy link
Member

@mattrobenolt mattrobenolt commented Nov 10, 2022

In general, both bugs fixed here are the result of protojson encoding and fields being omitted from the JSON response:

In the case of a NULL column, the NULL type is omitted from the types enum becasue it's numeric value is "0", and protojson omits this due to it being a default value.

In the case of select null, we get another edge case, where the values itself is entirely omitted due to it being an empty sequence of bytes. This case is exaggerated for sure, but it is likely to happen if an entire row is simply 1 column of NULL, or even multiple NULLs. So something like, select foo from table may yield if too if foo is allowed to be NULL.

Fixes #72

In general, both bugs fixed here are the result of protojson encoding
and fields being omitted from the JSON response:

In the case of a NULL column, the NULL type is omitted from the types
enum becasue it's numeric value is "0", and protojson omits this due to
it being a default value.

In the case of `select null`, we get another edge case, where the
`values` itself is entirely omitted due to it being an empty seuqence of
bytes.

Fixes #72
Copy link
Member

@dgraham dgraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! ⚡️

iheanyi and others added 2 commits November 18, 2022 12:05
Co-authored-by: David Graham <david.malcom.graham@gmail.com>
@iheanyi iheanyi enabled auto-merge November 18, 2022 18:06
@iheanyi iheanyi merged commit 3246e60 into main Nov 18, 2022
@iheanyi iheanyi deleted the handle-nulls-better branch November 18, 2022 18:06
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.

NULL types are mishandled
3 participants