parent
b5fb4840a9
commit
9507b187f1
|
@ -9,6 +9,8 @@
|
|||
|
||||
### Bugfixes
|
||||
|
||||
- [Issue #925](https://github.com/influxdb/influxdb/issues/925). Don't
|
||||
generate invalid query strings for single point queries
|
||||
- [Issue #1008](https://github.com/influxdb/influxdb/issues/1008). Return
|
||||
an appropriate exit status code depending on whether the process exits
|
||||
due to an error or exits gracefully.
|
||||
|
|
|
@ -190,6 +190,13 @@ func (self *SelectQuery) GetQueryString() string {
|
|||
}
|
||||
|
||||
func (self *SelectQuery) GetQueryStringWithTimeCondition() string {
|
||||
// if this is a single point query then it already has a time (and
|
||||
// sequence number) condition; we don't need the extra (time < ???
|
||||
// and time > ???) condition in the query string.
|
||||
if self.IsSinglePointQuery() {
|
||||
return self.GetQueryString()
|
||||
}
|
||||
|
||||
return self.commonGetQueryStringWithTimes(true, true, self.startTime, self.endTime)
|
||||
}
|
||||
|
||||
|
|
|
@ -929,6 +929,14 @@ func (self *QueryParserSuite) TestParseSinglePointQuery(c *C) {
|
|||
c.Assert(rightBoolExpression.Name, Equals, "=")
|
||||
}
|
||||
|
||||
func (self *QueryParserSuite) TestSinglePointGetQueryString(c *C) {
|
||||
qs := "select value from \"foo\" where (time = 999) AND (sequence_number = 1)"
|
||||
q, err := ParseSelectQuery(qs)
|
||||
c.Assert(err, IsNil)
|
||||
c.Assert(q.GetQueryString(), Equals, qs)
|
||||
c.Assert(q.GetQueryStringWithTimeCondition(), Equals, qs)
|
||||
}
|
||||
|
||||
// TODO: test reversed order of time and sequence_number
|
||||
func (self *QueryParserSuite) TestIsSinglePointQuery(c *C) {
|
||||
query := "select * from foo where time = 123 and sequence_number = 99"
|
||||
|
|
Loading…
Reference in New Issue