quaint icon indicating copy to clipboard operation
quaint copied to clipboard

No condition is translated as 1=1 for OR

Open dpetrick opened this issue 4 years ago • 1 comments

The visitor always translates a ConditionTree::NoCondition as 1=1, which leads to the unexpected outcome that for an OR filter, the entire expression becomes truthy.

After a cursory inspection of the visitor, I believe a fix would require the visitor to have context about the parent, which it isn't designed to have at the moment (as far as I can tell).

dpetrick avatar Nov 23 '20 11:11 dpetrick

Discussed with @pimeys that we should probably just rename NoCondition to something more expressive, like TrueCondition and FalseCondition to avoid setting the wrong expectations.

dpetrick avatar Nov 23 '20 13:11 dpetrick