Skip to content

fix: atomic parser #5064

Open
7ttp wants to merge 2 commits intosupabase:developfrom
7ttp:fix/atomic-supersedes
Open

fix: atomic parser #5064
7ttp wants to merge 2 commits intosupabase:developfrom
7ttp:fix/atomic-supersedes

Conversation

@7ttp
Copy link
Copy Markdown
Contributor

@7ttp 7ttp commented Apr 10, 2026

TL;DR

fixes SQL parser incorrectly treating function names containing "atomic" as BEGIN ATOMIC syntax

problem

saw multiple reports that:

The SQL parser treats any occurrence of "atomic" as BEGIN ATOMIC syntax,
even when it's part of a func somewhat like atomic_example()
which causes migrations to fail when a func with "atomic" in its name is followed by another statement

CREATE FUNCTION atomic_example() RETURNS INTEGER AS $$ ... $$;
GRANT EXECUTE ON FUNCTION atomic_example() TO authenticated;
-- ERROR: cannot insert multiple commands into a prepared statement

sol

check that "atomic" is actually part of BEGIN ATOMIC syntax,
not just a substring in an identifier
parser now verifies that both BEGIN and ATOMIC are standalone keywords, not part of function names or other identifiers.

ref:

@7ttp 7ttp requested a review from a team as a code owner April 10, 2026 21:16
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 24264555221

Coverage decreased (-0.02%) to 63.786%

Details

  • Coverage decreased (-0.02%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 5 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

5 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
internal/utils/git.go 5 57.14%

Coverage Stats

Coverage Status
Relevant Lines: 15356
Covered Lines: 9795
Line Coverage: 63.79%
Coverage Strength: 7.02 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants