Skip to content

Commit

Permalink
Close #561. Fix missing query string in parser errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chobie authored and pauldix committed May 27, 2014
1 parent d681a06 commit d9cc770
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [Issue #547](https://github.com/influxdb/influxdb/issues/547). Add difference function (Thanks, @mboelstra)
- [Issue #550](https://github.com/influxdb/influxdb/issues/550). Fix tests on 32-bit ARM
- [Issue #524](https://github.com/influxdb/influxdb/issues/524). Arithmetic operators and where conditions don't play nice together
- [Issue #561](https://github.com/influxdb/influxdb/issues/561). Fix missing query in parsing errors

## v0.6.5 [2014-05-19]

Expand Down
1 change: 1 addition & 0 deletions src/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ func ParseQuery(query string) ([]*Query, error) {
lastLine: int(q.error.last_line),
lastColumn: int(q.error.last_column) - 1,
errorString: str,
queryString: query,
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,13 @@ func (self *QueryParserSuite) TestParseColumnWithPeriodOrDash(c *C) {
c.Assert(column.Alias, Equals, "count-column-a.foo")
}

func (self *QueryParserSuite) TestQueryErrorShouldHaveQueryString(c *C) {
query := "select ! from foo;"
_, err := ParseSelectQuery(query)
e, _ := err.(*QueryError)
c.Assert(e.queryString, Equals, query)
}

// TODO:
// insert into user.events.count.per_day select count(*) from user.events where time<forever group by time(1d)
// insert into :series_name.percentiles.95 select percentile(95,value) from stats.* where time<forever group by time(1d)

0 comments on commit d9cc770

Please sign in to comment.