Skip to content

Commit

Permalink
Merge pull request #2191 from influxdb/calls_case
Browse files Browse the repository at this point in the history
Case-insensitive check for "fill"
  • Loading branch information
toddboom committed Apr 13, 2015
2 parents 4e28c3a + f5b7697 commit ebd8ca7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion influxql/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ func (p *Parser) parseFill() (FillOption, interface{}, error) {
p.unscan()
return NullFill, nil, nil
} else {
if lit.Name != "fill" {
if strings.ToLower(lit.Name) != "fill" {
p.unscan()
return NullFill, nil, nil
}
Expand Down
14 changes: 14 additions & 0 deletions influxql/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,20 @@ func TestParser_ParseStatement(t *testing.T) {
},
},

// SELECT statement with FILL(none) -- check case insensitivity
{
s: `SELECT mean(value) FROM cpu GROUP BY time(5m) FILL(none)`,
stmt: &influxql.SelectStatement{
Fields: []*influxql.Field{{
Expr: &influxql.Call{
Name: "mean",
Args: []influxql.Expr{&influxql.VarRef{Val: "value"}}}}},
Sources: []influxql.Source{&influxql.Measurement{Name: "cpu"}},
Dimensions: []*influxql.Dimension{{Expr: &influxql.Call{Name: "time", Args: []influxql.Expr{&influxql.DurationLiteral{Val: 5 * time.Minute}}}}},
Fill: influxql.NoFill,
},
},

// SELECT statement with previous fill
{
s: `SELECT mean(value) FROM cpu GROUP BY time(5m) fill(previous)`,
Expand Down

0 comments on commit ebd8ca7

Please sign in to comment.