From 3652183396cc8a73303ea520333fc34ff4a3abe5 Mon Sep 17 00:00:00 2001 From: Jackson Owens Date: Thu, 18 Apr 2024 16:50:05 -0400 Subject: [PATCH] internal/keyspan: fix interleaving iter intermediary state Previously in InterleavingIter.prevPos when a) moving from a point key b) the point key was contained within a span c) no lesser point key exists prevPos would improperly move to posKeyspanEnd instead of posKeyspanStart. This doesn't have any externally visible impact on the behavior of the InterleavingIter because end boundaries are not interleaved: prevPos is called again before returning to the user, ensuring we step to posKeyspanStart. With cases. --- internal/keyspan/interleaving_iter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/keyspan/interleaving_iter.go b/internal/keyspan/interleaving_iter.go index 82971e033a..557cfae21d 100644 --- a/internal/keyspan/interleaving_iter.go +++ b/internal/keyspan/interleaving_iter.go @@ -724,7 +724,7 @@ func (i *InterleavingIter) prevPos() { case i.span == nil: panic("withinSpan=true, but i.span == nil") case i.pointKV == nil: - i.pos = posKeyspanEnd + i.pos = posKeyspanStart default: // i.withinSpan && i.pointKey != nil && i.span != nil if i.cmp(i.span.Start, i.pointKV.K.UserKey) > 0 {