$__timeGroup
with fill parameter panics with "integer divide by zero" for interval below 1s
#43579
Labels
$__timeGroup
with fill parameter panics with "integer divide by zero" for interval below 1s
#43579
What happened:
When using
$__timeGroup
with a fill parameter (null, previous or 0) and an interval below 1s the query execution panics with the following error:lvl=eror msg="executeQuery panic" logger=tsdb.postgres error="runtime error: integer divide by zero" stack="[sql_engine.go:215 panic.go:1052 panic.go:200 resample.go:93 sql_engine.go:357]"
The division by zero is happening in the following line:
grafana/pkg/tsdb/sqleng/resample.go
Line 93 in 43c81dd
What you expected to happen:
I would expect that the macro also works for intervals below 1s because the
$__interval
variable delivers values in the millisecond range if zoomed in far enough (see screen recording below) and the minimum time interval that can be specified via data source settings can also be in millisecond range (see: https://grafana.com/docs/grafana/latest/datasources/postgres/#min-time-interval).This happens when using query builder:
...and also when using
$__timeGroup
/$__timeGroupAlias
in the text editor directly:How to reproduce it (as minimally and precisely as possible):
Environment:
The text was updated successfully, but these errors were encountered: