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: Fix handling of view table types when detecting schema. #2443

Merged
merged 3 commits into from
Jan 20, 2025

Conversation

matthewnolf
Copy link
Collaborator

PR Description

MySQL returns different column count for SHOW CREATE VIEW (2 columns) when compared to SHOW CREATE TABLE (4 columns).
This change adds conditional logic to handle both cases so that we can extract the schema of a view without generating an error.

There are a couple small refactors:

  • Log the table name when any operation related to schema detection fails, so that we can isolate the source of the issue
  • Introduce sub tests in the schema_table_test.go for the different scenarios

Which issue(s) this PR fixes

Notes to the Reviewer

PR Checklist

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

MySQL returns different column count for SHOW CREATE VIEW when
compared to SHOW CREATE TABLE. This change adds conditional logic
to handle both cases so that we can extract the schema of a view
without generating an error.
@matthewnolf matthewnolf force-pushed the mn/dbo11y-parse-view-schema branch from 6a8aa6c to dd4e2f8 Compare January 17, 2025 17:10
@matthewnolf matthewnolf merged commit 51176f4 into main Jan 20, 2025
18 checks passed
@matthewnolf matthewnolf deleted the mn/dbo11y-parse-view-schema branch January 20, 2025 10:24
clayton-cornell pushed a commit that referenced this pull request Jan 21, 2025
…ng schema. (#2443)

MySQL returns different column count for SHOW CREATE VIEW (2 columns) when compared to SHOW CREATE TABLE (4 columns).
This change adds conditional logic to handle both cases so that we can extract the schema of a view without generating an error.
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