Skip to content

fix: atomic parser #5064

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

fix: atomic parser #5064
avallete merged 3 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

coveralls commented Apr 10, 2026

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.

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

Coverage Stats

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

💛 - Coveralls

@avallete
Copy link
Copy Markdown
Member

Thank's for the fix !

@avallete avallete enabled auto-merge (squash) April 14, 2026 16:52
@avallete avallete merged commit 3be2887 into supabase:develop Apr 14, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants