Skip to content

fix: preserve trigger argument literals verbatim (#700) - #724

Merged
tianzhou merged 1 commit into
mainfrom
devin/1795885237-trigger-arg-literals
Nov 29, 2026
Merged

tianzhou merged 1 commit into
mainfrom
devin/1795885237-trigger-arg-literals

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #700. normalizeTriggerFunctionCall ran its whitespace/comma regexes over the whole EXECUTE FUNCTION call, so argument literals were rewritten ('a,b' → 'a, b', 'x, y' → 'x, y'). Those literals reach the function verbatim as TG_ARGV, so dump/apply changed trigger behavior, and plan couldn't see an argument change that only differed inside a literal.

  • normalizeTriggerFunctionCall now applies the regexes only to unquoted segments (via the existing splitQuotedSegments); '...' literals and "..." identifiers pass through untouched.
  • extractFunctionCallFromTriggerDef cut the call at the first ;, including one inside a literal ('c;d' produced 'c;). It now only stops at a ; outside quotes.

Tests: create_trigger/add_trigger adds a trigger with ('a,b', 'x, y', '{p,q}', 'it''s', 'c;d') (dumped byte for byte); create_trigger/alter_trigger changes ('id, name', 'x y') → ('id,name', 'x y'), which plan previously reported as no change.

Link to Devin session: https://app.devin.ai/sessions/314326a464fb4b3c9fbe6ccc32736cdf
Open in Devin Desktop: https://app.devin.ai/desktop/session/314326a464fb4b3c9fbe6ccc32736cdf?variant=devin
Requested by: @tianzhou


🟢 Devin Review found nothing to fix · View findings

Devin Review

Co-Authored-By: Tianzhou <t@bytebase.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@greptile-apps

greptile-apps Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Preserves quoted trigger arguments and identifiers when extracting and normalizing function calls.

  • Trigger calls keep quoted arguments intact in plans and dumps.

No actionable issues found. Tests were reviewed but not run.

Reviews (1) · Last reviewed commit: "fix: preserve trigger argument literals ..." · Reviewed by Greptile

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@tianzhou
tianzhou merged commit 00e6898 into main Nov 29, 2026
3 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

Development

Successfully merging this pull request may close these issues.

Trigger argument literals are reformatted ('a,b' becomes 'a, b'), changing what TG_ARGV receives

1 participant