Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix substring marker expression disjointness checks #4998

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

ibraheemdev
Copy link
Member

Summary

Noticed a bug here, 'a' in env and env not in 'a' are not disjoint given env == 'ab'.

@ibraheemdev ibraheemdev added bug Something isn't working preview Experimental behavior and removed preview Experimental behavior labels Jul 11, 2024
@@ -49,7 +49,46 @@ pub(crate) fn is_disjoint(first: &MarkerTree, second: &MarkerTree) -> bool {
fn string_is_disjoint(this: &MarkerExpression, other: &MarkerExpression) -> bool {
use MarkerOperator::*;

let (key, operator, value) = extract_string_expression(this).unwrap();
// The `in` and `not in` operators are not reversible, so we have to ensure the expressions match exactly.
Copy link
Member

Choose a reason for hiding this comment

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

Can you include an example here, as you did in the PR summary?

Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

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

Nice catch.

@ibraheemdev ibraheemdev enabled auto-merge (squash) July 12, 2024 15:13
@ibraheemdev ibraheemdev merged commit a1f71a3 into main Jul 12, 2024
49 checks passed
@ibraheemdev ibraheemdev deleted the ibraheem/substring-disjointness branch July 12, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants