Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database_observability: don't error out for insert with values #2716

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

cristiangreco
Copy link
Collaborator

PR Description

Statements like insert into table values (...) were logging an error even though the tables were correctly parsed.

Which issue(s) this PR fixes

n.a.

Notes to the Reviewer

PR Checklist

  • CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

Statements like `insert into table values (...)` were logging an error
even though the tables were correctly parsed.
@cristiangreco cristiangreco force-pushed the cristian/dbo11y-fix-insert-with-values branch from 73420ad to c979c33 Compare February 13, 2025 14:22
@@ -226,6 +226,8 @@ func (c QuerySample) tablesFromQuery(digest string, stmt sqlparser.Statement) []
case *sqlparser.Insert:
parsedTables = []string{c.parseTableName(stmt.Table)}
switch insRowsStmt := stmt.Rows.(type) {
case sqlparser.Values:
// ignore raw values
Copy link
Collaborator Author

@cristiangreco cristiangreco Feb 13, 2025

Choose a reason for hiding this comment

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

Don't need to update tests as with this change we're just going to skip a log -- the statement was already parsed correctly.

@cristiangreco cristiangreco marked this pull request as ready for review February 13, 2025 14:52
@cristiangreco cristiangreco merged commit 512db43 into main Feb 14, 2025
30 checks passed
@cristiangreco cristiangreco deleted the cristian/dbo11y-fix-insert-with-values branch February 14, 2025 08:39
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.

2 participants