Repository navigation
fix: preserve trigger argument literals verbatim (#700) - #724
Merged
Merged
Conversation
Co-Authored-By: Tianzhou <t@bytebase.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
[Medium impact] The PR appears safe to merge. SummaryPreserves quoted trigger arguments and identifiers when extracting and normalizing function calls.
No actionable issues found. Tests were reviewed but not run. Reviews (1) · Last reviewed commit: "fix: preserve trigger argument literals ..." · Reviewed by Greptile |
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.
Summary
Fixes #700.
normalizeTriggerFunctionCallran its whitespace/comma regexes over the wholeEXECUTE FUNCTIONcall, so argument literals were rewritten ('a,b'→'a, b','x, y'→'x, y'). Those literals reach the function verbatim asTG_ARGV, so dump/apply changed trigger behavior, and plan couldn't see an argument change that only differed inside a literal.normalizeTriggerFunctionCallnow applies the regexes only to unquoted segments (via the existingsplitQuotedSegments);'...'literals and"..."identifiers pass through untouched.extractFunctionCallFromTriggerDefcut 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_triggeradds a trigger with('a,b', 'x, y', '{p,q}', 'it''s', 'c;d')(dumped byte for byte);create_trigger/alter_triggerchanges('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