Skip to content

Allow appending SQL comments via DD_DBM_ALWAYS_APPEND_SQL_COMMENT#3954

Open
bwoebi wants to merge 1 commit into
masterfrom
bob/dbm-sql-append
Open

Allow appending SQL comments via DD_DBM_ALWAYS_APPEND_SQL_COMMENT#3954
bwoebi wants to merge 1 commit into
masterfrom
bob/dbm-sql-append

Conversation

@bwoebi
Copy link
Copy Markdown
Collaborator

@bwoebi bwoebi commented Jun 4, 2026

Modeled after DataDog/dd-trace-java#9798.

Fixes #3951.

@bwoebi bwoebi requested review from a team as code owners June 4, 2026 13:45
@bwoebi bwoebi requested review from LobeTia and removed request for a team June 4, 2026 13:45
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 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";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented Jun 4, 2026

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 37 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | ASAN test_c with multiple observers: [8.3]   View in Datadog   GitLab

See error Fatal error: Uncaught Exception: wait for replay timeout in /go/src/github.com/DataDog/apm-reliability/dd-trace-php/tmp/build_extension/tests/ext/includes/request_replayer.inc:100

DataDog/apm-reliability/dd-trace-php | benchmarks-tracer   View in Datadog   GitLab

See error Your requirements could not be resolved to an installable set of packages due to security advisories affecting required packages.

DataDog/apm-reliability/dd-trace-php | test_extension_ci: [7.0]   View in Datadog   GitLab

See error Failed to execute tests due to missing executables '/go/src/github.com/DataDog/apm-reliability/dd-trace-php/libtool' and '/go/src/github.com/DataDog/apm-reliability/dd-trace-php/tmp/build_extension/build/shtool'.

View all 37 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 54.12% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1d27b0f | Docs | Datadog PR Page | Give us feedback!

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.

[Feature]: Support appending DBM propagation SQL comments instead of prepending

1 participant