mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-25 12:59:06 +01:00
Fix using crossjoin arguments not used
This commit is contained in:
parent
ee4097a2dd
commit
119637cb9b
@ -587,7 +587,7 @@ func (r *JobRepository) jobsMetricStatisticsHistogram(
|
||||
crossJoinQuery = BuildWhereClause(f, crossJoinQuery)
|
||||
}
|
||||
|
||||
crossJoinQuerySql, _, sqlerr := crossJoinQuery.ToSql()
|
||||
crossJoinQuerySql, crossJoinQueryArgs, sqlerr := crossJoinQuery.ToSql()
|
||||
if sqlerr != nil {
|
||||
return nil, sqlerr
|
||||
}
|
||||
@ -601,7 +601,7 @@ func (r *JobRepository) jobsMetricStatisticsHistogram(
|
||||
fmt.Sprintf(`CAST(((value.max / %d) * (%s )) as INTEGER ) as min`, bins, binQuery),
|
||||
fmt.Sprintf(`CAST(((value.max / %d) * (%s + 1 )) as INTEGER ) as max`, bins, binQuery),
|
||||
).From("job").CrossJoin(
|
||||
fmt.Sprintf(`(%s) as value`, crossJoinQuerySql),
|
||||
fmt.Sprintf(`(%s) as value`, crossJoinQuerySql), crossJoinQueryArgs...,
|
||||
).Where(fmt.Sprintf(`job.%s is not null and job.%s <= %f`, dbMetric, dbMetric, peak))
|
||||
|
||||
mainQuery, qerr := SecurityCheck(ctx, mainQuery)
|
||||
|
Loading…
Reference in New Issue
Block a user