Skip to content

fix: first next_back() on new RowsIter panics#9505

Open
rluvaton wants to merge 1 commit intoapache:mainfrom
rluvaton:fix-rows-iter-next-back
Open

fix: first next_back() on new RowsIter panics#9505
rluvaton wants to merge 1 commit intoapache:mainfrom
rluvaton:fix-rows-iter-next-back

Conversation

@rluvaton
Copy link
Member

@rluvaton rluvaton commented Mar 4, 2026

Which issue does this PR close?

N/A

Rationale for this change

it should not panic

What changes are included in this PR?

correctly use last row in next_back

Are these changes tested?

yes

Are there any user-facing changes?

they can now use next_back

@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 4, 2026
Copy link
Contributor

@scovich scovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the row API, but this seems like a simple off-by-one error?

Comment on lines +1418 to 1419
let row = unsafe { self.rows.row_unchecked(self.end - 1) };
self.end -= 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just move the self.end decrement above the original unsafe block?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants