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

Boolean precedence issues within Queries #4478

Open
stroomdev00 opened this issue Sep 25, 2024 · 0 comments
Open

Boolean precedence issues within Queries #4478

stroomdev00 opened this issue Sep 25, 2024 · 0 comments
Assignees
Labels
Milestone

Comments

@stroomdev00
Copy link

If I have a number of records where fields look like:

...
<A>1</A>
<B>2</B>
...

interspersed with records with fields like:

...
<A>2</A>
<B>1</B>
...

and a number of records which match neither of the above.

Create a Query against this data.

Running a filter of A = "1" and B = "2" returns 4 records.
Running a filter of A = "2" and B = "1" returns 7 records.

A filter of A = "1" and B = "2" or A = "2" and B = "1" returns 7 records (should be 11).
A filter of (A = "2" and B = "2") or (A = "2" and B = "1") returns 11 records (correct).
A filter of A = "1" and B = "2" or A = "not2" and B = "not1" returns 0 records (should be 4).
A filter of A = "not1" and B = "not2" or A = "2" and B = "1" returns 7 records (correct).

all the above where not1 and not2 are values that never appear in the data.

It looks like the ANDs are not being handled before the ORs as expected, but the operators are being parsed sequentially in reverse order.

@stroomdev00 stroomdev00 added this to the v7.4 milestone Sep 25, 2024
@stroomdev66 stroomdev66 self-assigned this Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants