Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tag parsing #5382

Merged
merged 1 commit into from
Jan 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- [#5193](https://github.com/influxdata/influxdb/issues/5193): Missing data a minute before current time. Comes back later.
- [#5350](https://github.com/influxdata/influxdb/issues/5350): 'influxd backup' should create backup directory
- [#5262](https://github.com/influxdata/influxdb/issues/5262): Fix a panic when a tag value was empty.
- [#5382](https://github.com/influxdata/influxdb/pull/5382): Fixes some escaping bugs with tag keys and values.

## v0.9.6 [2015-12-09]

Expand Down
20 changes: 6 additions & 14 deletions models/points.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,10 @@ func scanLine(buf []byte, i int) (int, []byte) {
}

// scanTo returns the end position in buf and the next consecutive block
// of bytes, starting from i and ending with stop byte. If there are leading
// spaces or escaped chars, they are skipped.
// of bytes, starting from i and ending with stop byte, where stop byte
// has not been escaped.
//
// If there are leading spaces, they are skipped.
func scanTo(buf []byte, i int, stop byte) (int, []byte) {
start := i
for {
Expand All @@ -886,13 +888,8 @@ func scanTo(buf []byte, i int, stop byte) (int, []byte) {
break
}

if buf[i] == '\\' {
i += 2
continue
}

// reached end of block?
if buf[i] == stop {
if buf[i] == stop && buf[i-1] != '\\' {
break
}
i++
Expand Down Expand Up @@ -935,12 +932,7 @@ func scanTagValue(buf []byte, i int) (int, []byte) {
break
}

if buf[i] == '\\' {
i += 2
continue
}

if buf[i] == ',' {
if buf[i] == ',' && buf[i-1] != '\\' {
break
}
i++
Expand Down
Loading