Skip to content

Commit

Permalink
Re-check field type under write lock.
Browse files Browse the repository at this point in the history
  • Loading branch information
benbjohnson committed Mar 3, 2017
1 parent fab0b86 commit 4c202ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
- [#8044](https://github.com/influxdata/influxdb/issues/8044): Treat non-reserved measurement names with underscores as normal measurements.
- [#8078](https://github.com/influxdata/influxdb/issues/8078): Map types correctly when selecting a field with multiple measurements where one of the measurements is empty.
- [#8080](https://github.com/influxdata/influxdb/issues/8080): Point.UnmarshalBinary() bounds check
- [#8085](https://github.com/influxdata/influxdb/issues/8085): panic: interface conversion: tsm1.Value is tsm1.IntegerValue, not tsm1.FloatValue.


## v1.2.0 [2017-01-24]

Expand Down
5 changes: 5 additions & 0 deletions tsdb/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,12 @@ func (m *MeasurementFields) CreateFieldIfNotExists(name string, typ influxql.Dat

m.mu.Lock()
defer m.mu.Unlock()

// Re-check field and type under write lock.
if f := m.fields[name]; f != nil {
if f.Type != typ {
return ErrFieldTypeConflict
}
return nil
}

Expand Down

0 comments on commit 4c202ee

Please sign in to comment.