Skip to content

Commit

Permalink
Fix #538. Don't panic when the same series is written with different …
Browse files Browse the repository at this point in the history
…columns
  • Loading branch information
jvshahid authored and pauldix committed May 27, 2014
1 parent 747e003 commit 441228e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [Issue #516](https://github.com/influxdb/influxdb/issues/516). Close WAL log/index files when they aren't being used
- [Issue #532](https://github.com/influxdb/influxdb/issues/532). Don't log graphite connection EOF as an error
- [Issue #535](https://github.com/influxdb/influxdb/pull/535). WAL Replay hangs if response isn't received
- [Issue #538](https://github.com/influxdb/influxdb/pull/538). Don't panic if the same series existed twice in the request with different columns

## v0.6.2 [2014-05-09]

Expand Down
2 changes: 1 addition & 1 deletion src/coordinator/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ func (self *CoordinatorImpl) CommitSeriesData(db string, serieses []*protocol.Se
shardSerieses[seriesName] = newSeries
continue
}
s.Points = append(s.Points, newSeries.Points...)
shardSerieses[seriesName] = common.MergeSeries(s, newSeries)
}
}

Expand Down
16 changes: 16 additions & 0 deletions src/integration/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,22 @@ func (self *DataTestSuite) ExplainsWithLocalAggregator(c *C) (Fun, Fun) {
}
}

func (self *DataTestSuite) FuckedUpData(c *C) (Fun, Fun) {
return func(client Client) {
data := `[{"name":"foo","columns":["val0", "val1"],"points":[["a", 1]]},{"name":"foo","columns":["val0"],"points":[["b"]]}]`
client.WriteJsonData(data, c)
}, func(client Client) {
for v0, v1 := range map[string]interface{}{"a": 1.0, "b": nil} {
series := client.RunQuery(fmt.Sprintf("select * from foo where val0 = '%s'", v0), c, "m")
c.Assert(series, HasLen, 1)
c.Assert(series[0].Name, Equals, "foo")
maps := ToMap(series[0])
c.Assert(maps, HasLen, 1)
c.Assert(maps[0]["val1"], Equals, v1)
}
}
}

func (self *DataTestSuite) ExplainsWithLocalAggregatorAndRegex(c *C) (Fun, Fun) {
return func(client Client) {
data := `
Expand Down

0 comments on commit 441228e

Please sign in to comment.