diff --git a/CHANGELOG.md b/CHANGELOG.md index cfe8a34176b..6dc1988894f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] diff --git a/src/parser/parser.go b/src/parser/parser.go index 741d2c0b2b4..1f1a747b605 100644 --- a/src/parser/parser.go +++ b/src/parser/parser.go @@ -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, } } diff --git a/src/parser/parser_test.go b/src/parser/parser_test.go index a366d637d7a..0b149f81c17 100644 --- a/src/parser/parser_test.go +++ b/src/parser/parser_test.go @@ -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