From 583477064c8be336ad98f2cd45ba1c88d544de5f Mon Sep 17 00:00:00 2001 From: "Jonathan A. Sternberg" Date: Thu, 21 Jan 2016 10:49:33 -0500 Subject: [PATCH] Check for `tsdb.EOF` when looking for the lowest timestamp of aux fields --- tsdb/engine/tsm1/iterator.gen.go | 6 +++--- tsdb/engine/tsm1/iterator.gen.go.tmpl | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tsdb/engine/tsm1/iterator.gen.go b/tsdb/engine/tsm1/iterator.gen.go index b34a0bc385..139b0c9da1 100644 --- a/tsdb/engine/tsm1/iterator.gen.go +++ b/tsdb/engine/tsm1/iterator.gen.go @@ -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 } } diff --git a/tsdb/engine/tsm1/iterator.gen.go.tmpl b/tsdb/engine/tsm1/iterator.gen.go.tmpl index 980ef82b55..245d2dfc69 100644 --- a/tsdb/engine/tsm1/iterator.gen.go.tmpl +++ b/tsdb/engine/tsm1/iterator.gen.go.tmpl @@ -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 } }