Re-check field type under write lock.

pull/8092/head
Ben Johnson 2017-03-03 09:27:01 -07:00
parent fab0b86dc3
commit 4c202eea09
No known key found for this signature in database
GPG Key ID: 81741CD251883081
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
}