Check for `tsdb.EOF` when looking for the lowest timestamp of aux fields

pull/5196/head
Jonathan A. Sternberg 2016-01-21 10:49:33 -05:00 committed by Ben Johnson
parent 34f14424dd
commit 583477064c
2 changed files with 4 additions and 4 deletions

View File

@ -143,7 +143,7 @@ func (itr *floatIterator) Next() *influxql.FloatPoint {
} else {
// Otherwise find lowest aux timestamp.
for i := range itr.aux {
if k, _ := itr.aux[i].peek(); seek == tsdb.EOF || k < seek {
if k, _ := itr.aux[i].peek(); k != tsdb.EOF && (seek == tsdb.EOF || k < seek) {
seek = k
}
}
@ -471,7 +471,7 @@ func (itr *stringIterator) Next() *influxql.StringPoint {
} else {
// Otherwise find lowest aux timestamp.
for i := range itr.aux {
if k, _ := itr.aux[i].peek(); seek == tsdb.EOF || k < seek {
if k, _ := itr.aux[i].peek(); k != tsdb.EOF && (seek == tsdb.EOF || k < seek) {
seek = k
}
}
@ -799,7 +799,7 @@ func (itr *booleanIterator) Next() *influxql.BooleanPoint {
} else {
// Otherwise find lowest aux timestamp.
for i := range itr.aux {
if k, _ := itr.aux[i].peek(); seek == tsdb.EOF || k < seek {
if k, _ := itr.aux[i].peek(); k != tsdb.EOF && (seek == tsdb.EOF || k < seek) {
seek = k
}
}

View File

@ -142,7 +142,7 @@ func (itr *{{.name}}Iterator) Next() *influxql.{{.Name}}Point {
} else {
// Otherwise find lowest aux timestamp.
for i := range itr.aux {
if k, _ := itr.aux[i].peek(); seek == tsdb.EOF || k < seek {
if k, _ := itr.aux[i].peek(); k != tsdb.EOF && (seek == tsdb.EOF || k < seek) {
seek = k
}
}