Skip to content

Commit

Permalink
SQL generator update
Browse files Browse the repository at this point in the history
Ensure metric filter is not empty
  • Loading branch information
alpinskiy committed Nov 25, 2024
1 parent 0ab75f5 commit 8048704
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/api/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,8 @@ func sqlMaxHost(version string) string {
}

func writeMetricFilter(sb *strings.Builder, metricID int32, filterIn, filterNotIn []*format.MetricMetaValue, version string) {
if metricID != 0 {
emptyFilter := len(filterIn) == 0 && len(filterNotIn) == 0
if metricID != 0 || emptyFilter {
sb.WriteString(" AND ")
sb.WriteString(metricColumn(version))
sb.WriteString("=")
Expand Down

0 comments on commit 8048704

Please sign in to comment.