Fix regression parsing boolean True/False values

pull/3307/head
Jason Wilder 2015-07-13 11:27:24 -06:00
parent f077359f8c
commit ebd6e55997
3 changed files with 6 additions and 3 deletions

View File

@ -17,6 +17,7 @@
- [#3289](https://github.com/influxdb/influxdb/issues/3289): InfluxDB crashes on floats without decimal
- [#3298](https://github.com/influxdb/influxdb/pull/3298): Corrected WAL & flush parameters in default config. Thanks @jhorwit2
- [#3152](https://github.com/influxdb/influxdb/issues/3159): High CPU Usage with unsorted writes
- [#3307](https://github.com/influxdb/influxdb/pull/3307): Fix regression parsing boolean values True/False
## v0.9.1 [2015-07-02]

View File

@ -612,9 +612,9 @@ func scanBoolean(buf []byte, i int) (int, []byte, error) {
case 'f':
valid = bytes.Equal(buf[start:i], []byte("false"))
case 'T':
valid = bytes.Equal(buf[start:i], []byte("TRUE"))
valid = bytes.Equal(buf[start:i], []byte("TRUE")) || bytes.Equal(buf[start:i], []byte("True"))
case 'F':
valid = bytes.Equal(buf[start:i], []byte("FALSE"))
valid = bytes.Equal(buf[start:i], []byte("FALSE")) || bytes.Equal(buf[start:i], []byte("False"))
}
if !valid {

View File

@ -710,7 +710,7 @@ func TestParsePointWithStringWithEquals(t *testing.T) {
}
func TestParsePointWithBoolField(t *testing.T) {
test(t, `cpu,host=serverA,region=us-east true=true,t=t,T=T,TRUE=TRUE,false=false,f=f,F=F,FALSE=FALSE 1000000000`,
test(t, `cpu,host=serverA,region=us-east true=true,t=t,T=T,TRUE=TRUE,True=True,false=false,f=f,F=F,FALSE=FALSE,False=False 1000000000`,
NewPoint(
"cpu",
Tags{
@ -721,10 +721,12 @@ func TestParsePointWithBoolField(t *testing.T) {
"t": true,
"T": true,
"true": true,
"True": true,
"TRUE": true,
"f": false,
"F": false,
"false": false,
"False": false,
"FALSE": false,
},
time.Unix(1, 0)),