Skip to content

[57_maintenance] fix: Buffer::into_mutable return error instead of panic for converting owned sliced when not start at 0 and fix returned Mutable length - #11806

Merged
alamb merged 1 commit into
apache:57_maintenancefrom
Jefffrey:backport_10118_57
Oct 22, 2026
Merged

alamb merged 1 commit into
apache:57_maintenancefrom
Jefffrey:backport_10118_57

Conversation

@Jefffrey

Copy link
Copy Markdown
Contributor

…ing owned sliced when not start at 0 and fix returned Mutable length (apache#10118)

- Closes apache#10117

This include 2 fixes:

1. Calling `Buffer::into_mutable` on owned sliced that
`Buffer::ptr_offset() > 0` panicked before, now returning error
2. Calling `Buffer::into_mutable` on owned slice that
`Buffer::ptr_offset() == 0` returned `MutableBuffer` with length greater
than the original buffer length

1. Updating `Buffer::into_mutable` to return error when `ptr_offset > 0`
2. Set the returned `MutableBuffer` length to the original buffer length
so length is the same

yes

not really, except error instead of panic and correct mutable length
@Jefffrey Jefffrey added the bug Squash those bugs label Oct 22, 2026
@github-actions github-actions Bot added the arrow-core Core crates related to representing arrow data label Oct 22, 2026
@Jefffrey
Jefffrey marked this pull request as ready for review October 22, 2026 12:23
@alamb
alamb merged commit 183deb3 into apache:57_maintenance Oct 22, 2026
26 checks passed
@Jefffrey
Jefffrey deleted the backport_10118_57 branch October 22, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-core Core crates related to representing arrow data bug Squash those bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants