Repository navigation
fix(mcp): don't split an UPDATE on a semicolon inside a dollar-quoted value - #482
Merged
Merged
Conversation
… value #459 stopped splitting an UPDATE on a semicolon inside a single-quoted value. A dollar-quoted value ($t$a; b$t$) still split, so the first piece looked like an UPDATE without WHERE and execute_sql asked for confirmation. A dollar quote that opens inside an UPDATE is now blanked like a quoted span. DO and function bodies keep splitting so their statements are still checked. Refs #457
Coverage Report for CI Build 39929898422Coverage increased (+0.004%) to 97.564%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
raulb
approved these changes
Oct 23, 2026
Merged
Rodriguespn
pushed a commit
that referenced
this pull request
Oct 29, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>mcp-server-supabase: 0.15.0</summary> ## [0.15.0](mcp-server-supabase-v0.14.0...mcp-server-supabase-v0.15.0) (2026-10-29) ### Features * `submit_feedback` and `delete_feedback` tools ([#474](#474)) ([f50318a](f50318a)) * mark client-caused tool errors as ToolCallerError ([#480](#480)) ([4a619c1](4a619c1)) * **mcp-server-supabase:** detect instant elicitation cancels ([#483](#483)) ([5ad1a2a](5ad1a2a)) ### Bug Fixes * **mcp-server-supabase:** return a tool error when a confirmation expires ([#490](#490)) ([5ab9a98](5ab9a98)) * **mcp-server-supabase:** use POSIX path resolution for edge function filenames ([#393](#393)) ([55d2d24](55d2d24)) * **mcp:** don't split an UPDATE on a semicolon inside a dollar-quoted value ([#482](#482)) ([9f07410](9f07410)) * **mcp:** don't split an UPDATE on a semicolon inside a quoted value ([#459](#459)) ([6d93b50](6d93b50)) * **pg-meta:** order list_tables columns by ordinal position ([c242e63](c242e63)) * **pg-meta:** order primary key columns by key position and exclude INCLUDE columns ([#382](#382)) ([25d357c](25d357c)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
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.
What kind of change does this PR introduce?
Bug fix, follow-up to #459. Refs #457 and AI-1283.
What is the current behavior?
#459 stopped splitting an UPDATE on a
;inside a'...'value, but a dollar-quoted value still splits. So a normal update like this one asks for a destructive-SQL confirmation:The first piece (
update t set note = $t$keep it) has no WHERE, soisUpdateWithoutWherereturns true. We've seen this from a customer who writes long text values in dollar quotes. Every one of their cancelled UPDATEs had a;inside the text.What is the new behavior?
When a dollar quote opens inside an UPDATE,
splitStatementstreats it as a value. It blanks the quote the same way as a'...'span and doesn't split on its semicolons. Dollar quotes anywhere else (DO blocks, function bodies) still split like before, so the statements inside them are still checked. An unterminated dollar quote in an UPDATE falls back to the plain split, so it still flags.What was updated?
Splitter
splitStatementswhere a dollar tag opens. Check that it only applies when the current statement starts withupdate.Tests
$$and$tag$values, a$$inside a$t$value, two UPDATEs in one call).whereinside a dollar value, an UPDATE inside a function body, an unterminated dollar quote, a dollar value followed by a real second statement).