fix issue with seeking to last sample again

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
This commit is contained in:
György Krajcsovits 2026-01-22 18:08:41 +01:00
parent 091379dc44
commit ca530d7f85
No known key found for this signature in database
GPG Key ID: 47A8F9CE80FD7C7F
2 changed files with 5 additions and 1 deletions

View File

@ -110,10 +110,14 @@ func testChunk(t *testing.T, c Chunk, supportsST bool) {
ts, v = it3.At()
res3 = append(res3, triple{st: it3.AtST(), t: ts, v: v})
lastTs := ts
for it3.Next() == ValFloat {
ts, v := it3.At()
lastTs = ts
res3 = append(res3, triple{st: it3.AtST(), t: ts, v: v})
}
// Seeking to last timestamp should work and it is a no-op.
require.Equal(t, ValFloat, it3.Seek(lastTs))
require.NoError(t, it3.Err())
require.Equal(t, exp[mid:], res3)
require.Equal(t, ValNone, it3.Seek(exp[len(exp)-1].t+1))

View File

@ -207,7 +207,7 @@ type xorOptSTtIterator struct {
}
func (it *xorOptSTtIterator) Seek(t int64) ValueType {
if it.state == eofState {
if it.err != nil {
return ValNone
}