Merged
Conversation
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.
What problem does this PR solve?
Boolean-wrapped range predicates such as
(c1 > 10) = false,(c1 > 10) != true, andNOT (c1 > 10)were not normalized into simple range comparisons before index range detaching.The range detacher also treated some non-transparent expression wrappers as if they were safe to inspect directly, which could detach an unsafe subset range from predicates that were not conjunctions.
Issue link:
What is changed and how it works?
(c1 > 10) = false->c1 <= 10(c1 > 10) != true->c1 <= 10NOT (c1 > 10)->c1 <= 10AND.Code changes
Check List
Tests
Side effects
Note for reviewer
Main review surface:
SimplifyFilter.RangeDetachersoundness around partial range preservation and wrapper traversal.where_by_indexresult/explain coverage for normalized predicates usingpk_index => (-inf, 10].Validation used for this branch:
cargo fmt --checkcargo test boolean_wrapped_range_comparison --libcargo test range_detacher --libcargo run -p sqllogictest-test -- --path 'tests/slt/where_by_index*.slt'