Repository navigation
Reject out-of-range numeric filterBy columns instead of overflowing (#573) - #591
Merged
Merged
Conversation
MarekSpodBiedry
marked this pull request as ready for review
October 12, 2026 06:53
# Conflicts: # crates/engine/src/cmd/data.rs
Member
|
Merged — thank you @MarekSpodBiedry for the contribution! I merged main into your branch and resolved the conflicts with PRs that landed first (and adjusted tests where the combination needed it). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #573.
data.filterByaccepts a 0-based numeric column offset.col_paramturned it into a column withbase + o as u32. Theascast truncated au64silently, and the addition could overflow before the range check ran. In a debug build the overflow panicked, and the session sent back an internal error instead of the usual parameter error.Changes:
col_paramnow usesu32::try_fromandchecked_add, so a number that cannot be a column returnsNoneinstead of overflowing.filter_byreports a numericcolumnthat does not fit ascolumn outside the filter range, the same error a small out-of-range offset such as2or the letter"D"already gets. A missing or non-numericcolumnstill returnsmissing \column``.The other
col_paramcallers (sort, removeDuplicates, subtotal) also stop overflowing. A huge number there goes through the same path an unusable column already takes in each of them, so their behaviour for valid input does not change.Test:
filter_by_huge_numeric_column_is_rejected_not_overfloweduses the issue's setup (B1:C3 with an AutoFilter). It checks that2,u32::MAXandu64::MAXall return the parameter error, and that the valid offset0still hides exactly one row. Without the fix,u32::MAXoverflows and the test fails.