Skip to content

Commit

Permalink
Merge pull request #1049 from influxdb/fix-988
Browse files Browse the repository at this point in the history
Fix #988: top/bottom error messages
  • Loading branch information
toddboom committed Oct 23, 2014
2 parents 06f0798 + 8367a29 commit 69b2515
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions engine/aggregator_operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,10 @@ func NewTopOrBottomAggregator(name string, v *parser.Value, isTop bool, defaultV
return nil, err
}

if limit < 1 {
return nil, common.NewQueryError(common.InvalidArgument, fmt.Sprintf("function %s() second parameter must be > 0", name))
}

return &TopOrBottomAggregator{
AbstractAggregator: AbstractAggregator{
value: v.Elems[0],
Expand Down

0 comments on commit 69b2515

Please sign in to comment.