Skip to content

Commit

Permalink
Merge pull request cockroachdb#92282 from THardy98/backport22.1-77642
Browse files Browse the repository at this point in the history
release-22.1: server: correctly query index usage stats for db/table names with quotation marks
  • Loading branch information
Thomas Hardy authored Nov 22, 2022
2 parents ba1d8e7 + c46f321 commit 82efd56
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/server/index_usage_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ func getTableIDFromDatabaseAndTableName(
return 0, err
}
names := strings.Split(fqtName, ".")

// Strip quotations marks from db and table names.
for idx := range names {
names[idx] = strings.Trim(names[idx], "\"")
}
q := makeSQLQuery()
q.Append(`SELECT table_id FROM crdb_internal.tables WHERE database_name = $ `, names[0])

Expand Down

0 comments on commit 82efd56

Please sign in to comment.