Skip to content

fix(database_observability.mysql): Make query sample text nullable in MySQL query details collector#5425

Merged
fridgepoet merged 1 commit intomainfrom
cursor/null-to-string-conversion-d8b7
Feb 4, 2026
Merged

fix(database_observability.mysql): Make query sample text nullable in MySQL query details collector#5425
fridgepoet merged 1 commit intomainfrom
cursor/null-to-string-conversion-d8b7

Conversation

@fridgepoet
Copy link
Contributor

@fridgepoet fridgepoet commented Feb 3, 2026

This PR handles NULL query_sample_text in the MySQL query details collector.

This PR addresses a sql: Scan error on column index 3, name "query_sample_text": converting NULL to string is unsupported when scanning results from the summary table samples.

The query_sample_text column in internal/component/database_observability/mysql/collector/query_details.go has been updated from a string to sql.NullString to correctly handle NULL values from the database.

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated

Open in Cursor Open in Web

@cursor
Copy link

cursor bot commented Feb 3, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@CLAassistant
Copy link

CLAassistant commented Feb 3, 2026

CLA assistant check
All committers have signed the CLA.

@fridgepoet fridgepoet marked this pull request as ready for review February 4, 2026 11:16
@fridgepoet fridgepoet requested a review from a team as a code owner February 4, 2026 11:16
@fridgepoet fridgepoet changed the title Null to string conversion database_observability: fix null to string conversion for query sample text in MySQL query details collector Feb 4, 2026
@fridgepoet fridgepoet changed the title database_observability: fix null to string conversion for query sample text in MySQL query details collector fix: make query sample text nullable in MySQL query details collector for database_observability Feb 4, 2026
@fridgepoet fridgepoet changed the title fix: make query sample text nullable in MySQL query details collector for database_observability fix: Make query sample text nullable in MySQL query details collector for database_observability Feb 4, 2026
@fridgepoet fridgepoet force-pushed the cursor/null-to-string-conversion-d8b7 branch from cb1d9fb to 42cbd04 Compare February 4, 2026 11:31
@fridgepoet fridgepoet enabled auto-merge (squash) February 4, 2026 11:40
@fridgepoet fridgepoet merged commit 02ecc81 into main Feb 4, 2026
47 of 48 checks passed
@fridgepoet fridgepoet deleted the cursor/null-to-string-conversion-d8b7 branch February 4, 2026 11:50
@grafana-alloybot grafana-alloybot bot mentioned this pull request Feb 4, 2026
@cristiangreco cristiangreco changed the title fix: Make query sample text nullable in MySQL query details collector for database_observability fix(database_observability.mysql): Make query sample text nullable in MySQL query details collector Feb 12, 2026
@cristiangreco cristiangreco added the backport/v1.13 Backport to release/v1.13 label Feb 12, 2026
grafana-alloybot bot pushed a commit that referenced this pull request Feb 12, 2026
… for database_observability (#5425)

(cherry picked from commit 02ecc81)
cristiangreco pushed a commit that referenced this pull request Feb 12, 2026
… MySQL query details collector [backport] (#5519)

## Backport of #5425

This PR backports #5425 to release/v1.13.

### Original PR Author
@fridgepoet

### Description
This PR handles NULL `query_sample_text` in the MySQL query details
collector.

This PR addresses a `sql: Scan error on column index 3, name
"query_sample_text": converting NULL to string is unsupported` when
scanning results from the `summary table samples`.

The `query_sample_text` column in
`internal/component/database_observability/mysql/collector/query_details.go`
has been updated from a `string` to `sql.NullString` to correctly handle
NULL values from the database.

### PR Checklist

- [ ] Documentation added
- [x] Tests updated
- [ ] Config converters updated

<a
href="https://cursor.com/background-agent?bcId=bc-a95f4c5e-11ef-530f-a7b3-448bd2ef0888"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/agents?id=bc-a95f4c5e-11ef-530f-a7b3-448bd2ef0888"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>



---
*This backport was created automatically.*

Co-authored-by: Shirley <4163034+fridgepoet@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

backport/v1.13 Backport to release/v1.13 frozen-due-to-age

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants