Skip to content

Commit

Permalink
Merge pull request #3307 from influxdb/jw-bools
Browse files Browse the repository at this point in the history
Fix regression parsing boolean True/False values
  • Loading branch information
jwilder committed Jul 13, 2015
2 parents f077359 + ebd6e55 commit 792b074
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
4 changes: 2 additions & 2 deletions tsdb/points.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 3 additions & 1 deletion tsdb/points_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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)),
Expand Down

0 comments on commit 792b074

Please sign in to comment.