fix: preserve statement boundaries after PostgreSQL routines - #2650
Merged
manticore-projects merged 2 commits intoSep 20, 2026
Merged
manticore-projects merged 2 commits into
manticore-projects merged 2 commits into
Conversation
Contributor
|
Please resolve conflicts. |
Contributor
Author
|
@manticore-projects Thanks for flagging this!
Merged the latest The full Gradle Commit: c52b59ad |
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.
PostgreSQL routines with
AS '...'bodies can consume every following statement. For example,CREATE FUNCTION f() RETURNS integer AS 'SELECT 1;' LANGUAGE sql; SELECT 2;currently becomes oneCreateFunction. Recognize the quoted body and stop at the declaration's terminating semicolon so the second statement receives its own AST.Fixes #1994.
CREATE FUNCTIONandCREATE PROCEDURE, preserving ordinary, escape and dollar-quoted text plus trailing routine options.E'...'escapes without enabling backslash escaping for ordinary strings.SELECT. PostgreSQL-specific syntax requiresDialect.POSTGRESQL.The existing declaration-parts API remains in place. Routine bodies stay opaque: this does not validate PL/pgSQL source or expose its internal statements as an AST. The issue's abbreviated body is tested for preservation; executable PostgreSQL examples are checked separately.
Validation:
toStringand statement deparser round trips, consecutive routines/DDL, EOF, malformed quoting, trailing parse errors and existing unquoted routine behavior.check: 7,510 tests, no failures or errors, 25 skipped; grammar ambiguity, formatting and static checks passed.clean verify: 7,492 tests, no failures or errors, 25 skipped.toStringoutput and visitor output (66 successful executions). The following statement ran in each case, and PostgreSQL's storedprosrcmatched across all three forms.Syntax references: CREATE FUNCTION, CREATE PROCEDURE, and string constants.