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

[receiver/mysql] client, convert NULL to int64 #34411

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions receiver/mysqlreceiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,11 @@ func (c *mySQLClient) getInnodbStats() (map[string]string, error) {

// getTableStats queries the db for information_schema table size metrics.
func (c *mySQLClient) getTableStats() ([]TableStats, error) {
query := "SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_ROWS, " +
"AVG_ROW_LENGTH, DATA_LENGTH, INDEX_LENGTH " +
query := "SELECT TABLE_SCHEMA, TABLE_NAME, " +
"COALESCE(TABLE_ROWS, 0) as TABLE_ROWS, " +
djaglowski marked this conversation as resolved.
Show resolved Hide resolved
"COALESCE(AVG_ROW_LENGTH, 0) as AVG_ROW_LENGTH, " +
"COALESCE(DATA_LENGTH, 0) as DATA_LENGTH, " +
"COALESCE(INDEX_LENGTH, 0) as INDEX_LENGTH " +
"FROM information_schema.TABLES " +
"WHERE TABLE_SCHEMA NOT in ('information_schema', 'sys');"
rows, err := c.client.Query(query)
Expand Down
Loading