Skip to content
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

JSON materialization code should be resilient to incorrect JSON documents #32194

Closed
roji opened this issue Oct 31, 2023 · 1 comment
Closed
Assignees
Labels
area-json area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. Servicing-approved type-bug
Milestone

Comments

@roji
Copy link
Member

roji commented Oct 31, 2023

This JSON materialization code needs to be made resilient to malformed JSON content. In general, when reading JSON tokens, we should be defensive and immediately throw for any unexpected token. We should also do a pass over other JSON processing code (especially anything with flow control/loops) and ensure that it's resilient.

Note: this was discovered while porting JSON owned entity support to PostgreSQL (test JsonQueryAdHocTestBase.Junk_in_json_basic_no_tracking). At this point I'm still investigating what caused the incorrect JSON document, but we should be resilient to this in any case.

@roji
Copy link
Member Author

roji commented Nov 4, 2023

Note: the Junk_in_json_basic_no_tracking failure on PG happened because of #32235, i.e. without having actual malformed JSON data in the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-json area-query closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. Servicing-approved type-bug
Projects
None yet
Development

No branches or pull requests

3 participants