Fix #565. Make sure empty series names don't cause a panic
parent
953137a77d
commit
0914e8e25d
|
@ -11,6 +11,7 @@
|
|||
- [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
|
||||
- [Issue #565](https://github.com/influxdb/influxdb/issues/565). Empty series names shouldn't cause a panic
|
||||
|
||||
## v0.6.5 [2014-05-19]
|
||||
|
||||
|
|
|
@ -641,6 +641,10 @@ func (self *CoordinatorImpl) CommitSeriesData(db string, serieses []*protocol.Se
|
|||
series.SortPointsTimeDescending()
|
||||
|
||||
for i := 0; i < len(series.Points); {
|
||||
if len(series.GetName()) == 0 {
|
||||
return fmt.Errorf("Series name cannot be empty")
|
||||
}
|
||||
|
||||
shard, err := self.clusterConfiguration.GetShardToWriteToBySeriesAndTime(db, series.GetName(), series.Points[i].GetTimestamp())
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -95,6 +95,19 @@ func (self *SingleServerSuite) TestInvalidPercentile(c *C) {
|
|||
c.Assert(err, ErrorMatches, ".*wildcard.*")
|
||||
}
|
||||
|
||||
// issue #565
|
||||
func (self *SingleServerSuite) TestInvalidSeriesName(c *C) {
|
||||
client := self.server.GetClient("db1", c)
|
||||
series := &influxdb.Series{
|
||||
Name: "",
|
||||
Columns: []string{"foo", "bar"},
|
||||
Points: [][]interface{}{
|
||||
[]interface{}{1.0, 2.0},
|
||||
},
|
||||
}
|
||||
c.Assert(client.WriteSeries([]*influxdb.Series{series}), ErrorMatches, ".*\\(400\\).*empty.*")
|
||||
}
|
||||
|
||||
// issue #497
|
||||
func (self *SingleServerSuite) TestInvalidDataWrite(c *C) {
|
||||
client := self.server.GetClient("db1", c)
|
||||
|
|
Loading…
Reference in New Issue