Merge pull request #8092 from benbjohnson/field-type-conflict-write-check

Re-check field type under write lock.
pull/8095/head
Ben Johnson 2017-03-03 14:18:06 -07:00 committed by GitHub
commit f632770cda
2 changed files with 7 additions and 0 deletions

View File

@ -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]

View File

@ -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
}