Fix #537. Incorrect query syntax shouldn't causes internal error
parent
a6547c5bd9
commit
953137a77d
|
@ -10,6 +10,7 @@
|
|||
- [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
|
||||
- [Issue #563](https://github.com/influxdb/influxdb/issues/563). Add sample config for graphite over udp
|
||||
- [Issue #537](https://github.com/influxdb/influxdb/issues/537). Incorrect query syntax causes internal error
|
||||
|
||||
## v0.6.5 [2014-05-19]
|
||||
|
||||
|
|
|
@ -449,7 +449,6 @@ func NewDerivativeAggregator(q *parser.SelectQuery, v *parser.Value, defaultValu
|
|||
}, nil
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Difference Aggregator
|
||||
//
|
||||
|
@ -546,7 +545,6 @@ func NewDifferenceAggregator(q *parser.SelectQuery, v *parser.Value, defaultValu
|
|||
}, nil
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Histogram Aggregator
|
||||
//
|
||||
|
@ -903,6 +901,11 @@ func NewPercentileAggregator(_ *parser.SelectQuery, value *parser.Value, default
|
|||
if len(value.Elems) != 2 {
|
||||
return nil, common.NewQueryError(common.WrongNumberOfArguments, "function percentile() requires exactly two arguments")
|
||||
}
|
||||
|
||||
if value.Elems[0].Type == parser.ValueWildcard {
|
||||
return nil, common.NewQueryError(common.WrongNumberOfArguments, "wildcard cannot be used with percentile")
|
||||
}
|
||||
|
||||
percentile, err := strconv.ParseFloat(value.Elems[1].Name, 64)
|
||||
|
||||
if err != nil || percentile <= 0 || percentile >= 100 {
|
||||
|
|
|
@ -80,6 +80,21 @@ func (self *SingleServerSuite) TestListSeriesAfterDropSeries(c *C) {
|
|||
c.Assert(series, HasLen, 0)
|
||||
}
|
||||
|
||||
// issue #497
|
||||
func (self *SingleServerSuite) TestInvalidPercentile(c *C) {
|
||||
client := self.server.GetClient("db1", c)
|
||||
series := &influxdb.Series{
|
||||
Name: "test_invalid_percentile",
|
||||
Columns: []string{"foo", "bar"},
|
||||
Points: [][]interface{}{
|
||||
[]interface{}{1.0, 2.0},
|
||||
},
|
||||
}
|
||||
c.Assert(client.WriteSeries([]*influxdb.Series{series}), IsNil)
|
||||
_, err := client.Query("select percentile(*,95) from test_invalid_percentile")
|
||||
c.Assert(err, ErrorMatches, ".*wildcard.*")
|
||||
}
|
||||
|
||||
// issue #497
|
||||
func (self *SingleServerSuite) TestInvalidDataWrite(c *C) {
|
||||
client := self.server.GetClient("db1", c)
|
||||
|
|
Loading…
Reference in New Issue