Skip to content

Commit a370be5

Browse files
committed
internal/keyspan: fix swallowed error in InterleavingIter.NextPrefix
Previously if the internal point iterator encountered an error during NextPrefix and the iterator was currently positioned within a span, the InterleavingIter improperly swallowed the error without surfacing an exhausted iterator position (indicating that the caller should call Error()). Fix #5032. Informs #2785.
1 parent 6630a64 commit a370be5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/keyspan/interleaving_iter.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,9 @@ func (i *InterleavingIter) NextPrefix(succKey []byte) *base.InternalKV {
492492
return nil
493493
case posPointKey:
494494
i.savePoint(i.pointIter.NextPrefix(succKey))
495-
if i.withinSpan {
495+
if i.err != nil {
496+
i.pos = posExhausted
497+
} else if i.withinSpan {
496498
if i.pointKV == nil || i.cmp(i.span.End, i.pointKV.K.UserKey) <= 0 {
497499
i.pos = posKeyspanEnd
498500
} else {

0 commit comments

Comments
 (0)