Skip to content

Commit

Permalink
add test to prevent future parsing regressions for time durations
Browse files Browse the repository at this point in the history
  • Loading branch information
corylanou committed Sep 16, 2016
1 parent e2b38f6 commit acbf193
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions influxql/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,23 @@ func TestParser_ParseStatement(t *testing.T) {
},
},
},
// SELECT statement with group by and multi digit duration (prevent regression from #731://github.com/influxdata/influxdb/pull/7316)
{
s: fmt.Sprintf(`SELECT count(value) FROM cpu where time < '%s' group by time(500ms)`, now.UTC().Format(time.RFC3339Nano)),
stmt: &influxql.SelectStatement{
Fields: []*influxql.Field{{
Expr: &influxql.Call{
Name: "count",
Args: []influxql.Expr{&influxql.VarRef{Val: "value"}}}}},
Sources: []influxql.Source{&influxql.Measurement{Name: "cpu"}},
Condition: &influxql.BinaryExpr{
Op: influxql.LT,
LHS: &influxql.VarRef{Val: "time"},
RHS: &influxql.StringLiteral{Val: now.UTC().Format(time.RFC3339Nano)},
},
Dimensions: []*influxql.Dimension{{Expr: &influxql.Call{Name: "time", Args: []influxql.Expr{&influxql.DurationLiteral{Val: 500 * time.Millisecond}}}}},
},
},

// SELECT statement with fill
{
Expand Down

0 comments on commit acbf193

Please sign in to comment.