Skip to content

Commit

Permalink
internal/keyspan: fix interleaving iter intermediary state
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jbowens committed Apr 19, 2024
1 parent e751b78 commit 3652183
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/keyspan/interleaving_iter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3652183

Please sign in to comment.