[plsql] Fix for #3646 -- removed warning "rule json_function contains an optional block with at least one alternative that can match an empty string" #3648
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.
This is a fix for #3646.
In this PR, the json_function rule contains the expression json_query_returning_clause?, which causes the warning
"rule json_function contains an optional block with at least one alternative that can match an empty string"
. It turns out that json_query_returning_clause is nullable. The Spec contains the same error. https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/JSON_QUERY.html#GUID-6D396EC4-D2AA-43D2-8F5D-08D646A4A2D9Until the Spec is fixed, the ?-operator on json_query_returning_clause should be removed. The alternative is to rewrite json_query_returning_clause so that is not nullable, a more complicated task.
I added a test to make sure json_query_returning_clause is used. (It was not up to this point. See attached cover.html).