Allow appending SQL comments via DD_DBM_ALWAYS_APPEND_SQL_COMMENT#3954
Allow appending SQL comments via DD_DBM_ALWAYS_APPEND_SQL_COMMENT#3954bwoebi wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d27b0fa59
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return $comment; | ||
| } | ||
| if ($append) { | ||
| return "$query $comment"; |
There was a problem hiding this comment.
Insert appended comments before a trailing semicolon
When append mode is enabled, semicolon-terminated queries such as SELECT 1; are rewritten as SELECT 1; /*dd...*/. In contexts that treat ; as the statement boundary, the DBM comment is no longer attached to the statement and can be parsed as a separate empty/comment-only statement, which can break execution or lose correlation for the exact queries this new append mode affects. Please place the comment before a final statement terminator instead of always concatenating it after the whole query.
Useful? React with 👍 / 👎.
|
Modeled after DataDog/dd-trace-java#9798.
Fixes #3951.