fix #223. Add a test to make sure the panic is fixed

pull/223/head
John Shahid 2014-01-31 15:13:53 -05:00
parent 314ceac128
commit aaf2b818ac
1 changed files with 11 additions and 0 deletions

View File

@ -270,6 +270,17 @@ func (self *ServerSuite) TestWritingNullInCluster(c *C) {
c.Assert(collection.Members, HasLen, 1)
c.Assert(collection.GetSeries("test_null_in_cluster", c).Points, HasLen, 2)
}
func (self *ServerSuite) TestCountDistinctWithNullValues(c *C) {
data := `[{"name":"test_null_with_distinct","columns":["column"],"points":[["value1"], [null], ["value2"], ["value1"], [null]]}]`
self.serverProcesses[0].Post("/db/test_rep/series?u=paul&p=pass", data, c)
collection := self.serverProcesses[0].Query("test_rep", "select count(distinct(column)) from test_null_with_distinct group by time(1m)", false, c)
c.Assert(collection.Members, HasLen, 1)
series := collection.GetSeries("test_null_with_distinct", c)
c.Assert(series.GetValueForPointAndColumn(0, "count", c), Equals, float64(2))
}
func (self *ServerSuite) TestDataReplication(c *C) {
data := `
[{