mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 01:15:46 +08:00
PostgreSQL: __unixEpochGroup to support arithmetic expression as argument (#46764)
* __unixEpochGroup to support arithmetic argument Following call generates wrong expression : $__unixEpochGroupAlias(height+42,$__interval) => floor(height+42/60)*60 AS "time" instead of => floor((height+42)/60)*60 AS "time" * Update test of __unixEpochGroup related to issue #46764
This commit is contained in:
@ -146,7 +146,7 @@ func (m *postgresMacroEngine) evaluateMacro(timeRange backend.TimeRange, query *
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
return fmt.Sprintf("floor(%s/%v)*%v", args[0], interval.Seconds(), interval.Seconds()), nil
|
||||
return fmt.Sprintf("floor((%s)/%v)*%v", args[0], interval.Seconds(), interval.Seconds()), nil
|
||||
case "__unixEpochGroupAlias":
|
||||
tg, err := m.evaluateMacro(timeRange, query, "__unixEpochGroup", args)
|
||||
if err == nil {
|
||||
|
Reference in New Issue
Block a user