Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds the type
jsonpath, asjsonpath_scan.l,jsonpath_gram.yandjsonpath.chave it. The functions that execute a path, such asjsonb_path_queryand the operators@?and@@, are not in this change.Changes
rupg-typeshas the newJsonPath,PathItemandValue::JsonPath. A value is the tree of the path. The items that follow an item are in a list, so a long chain of accessors does not use deep recursion.yytext, so each syntax error names the same text as PostgreSQL. This includes the rules for numbers with trailing junk, names that a comment follows, and the escapes\x,\uand\u{}with pairs of surrogates.jsonpath_parsehas the checks offlattenJsonPathParseItemfor@andlast, the flags oflike_regexand the check of its pattern, and the check of the arguments of.decimal().jsonpath_deparse,jsonpath_sendandjsonpath_recvgive the text and binary forms, asprintJsonPathItemwrites them.rupg-funchas the text and binary input and output. A number that is too large and a path that is too deep are errors thatpg_input_is_validdoes not catch, as in PostgreSQL. The message for a code point that is too large is not the same in the soft input, as in PostgreSQL.jsonpathin a stored expression keeps the bytes of its binary form.Known differences
max_stack_depth. Here the limit is 1000 levels, as the analyzer has for an expression. The error is the same.Tests
jsonpathis the output of PostgreSQL 19 for the same script in a new database. It has 176 statements, and 110 of them end with an error. It has the input of each kind of item, the escapes and the comments, the errors of the scanner and the parser, the output, arrays,pg_input_is_valid,pg_input_error_info, text and binaryCOPYand a query with parameters.