Skip to content

fix: atomic parser - #5064

Merged
avallete merged 3 commits into
supabase:developfrom
7ttp:fix/atomic-supersedes
Apr 14, 2026
Merged

fix: atomic parser #5064
avallete merged 3 commits into
supabase:developfrom
7ttp:fix/atomic-supersedes

Conversation

@7ttp

@7ttp7ttp commented Apr 10, 2026

Copy link
Copy Markdown
Member

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

CREATEFUNCTIONatomic_example() RETURNS INTEGERAS $$ ... $$;
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:

@ghost
ghost self-requested a review as a code ownerApril 10, 2026 21:16

ghost commented Apr 10, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 24411795788

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage decreased (-0.02%) to 63.751%

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.

FileLines Losing CoverageCoverage
internal/utils/git.go557.14%

Coverage Stats

Coverage Status
Relevant Lines:15363
Covered Lines:9794
Line Coverage:63.75%
Coverage Strength:7.03 hits per line

💛 - Coveralls

ghost commented Apr 14, 2026

Copy link
Copy Markdown
Member

Thank's for the fix !

@ghost
ghost enabled auto-merge (squash) April 14, 2026 16:52
@ghost
ghost merged commit 3be2887 into supabase:developApr 14, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants

@7ttp@coveralls@avallete