Support PostgreSQL tagged dollar strings and preserve literal bodies - #2572
Open
minleejae wants to merge 1 commit into
Open
Support PostgreSQL tagged dollar strings and preserve literal bodies#2572minleejae wants to merge 1 commit into
minleejae wants to merge 1 commit into
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.
Tagged PostgreSQL strings such as
$json$…$json$currently fail to parse or become column references. Recognize them asStringValuewhile preserving the exact delimiter, whitespace and literal contents:Reuse a shared delimiter recognizer in the lexer,
StringValueand routine-body boundary detection. The lexer reads the original character stream with a linear delimiter matcher, handles longest-match identifier tokens, and updates token end positions. Dollar-quoted values keep doubled apostrophes unchanged ingetNotExcapedValue(). A tagged routine body remains one token, so a following SQL statement is preserved.Tagged quoting is enabled by default. For dialects that use the same spelling as an unquoted identifier,
withDollarQuotedStringTags(false)preserves the previous identifier interpretation; ordinary dollar-containing identifiers, positional parameters and untagged$$literals remain supported.Validation:
checkand Mavenverify.Fixes #2233.