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
Precedence problem with operator IS [CORE5193] #5474
Comments
Modified by: @asfernandesassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Commented by: @sim1984 That's a moot point. According to the documentation of such operator precedence However, the documentation does not say anything about the priority of the predicate IS [NOT] {TRUE | FALSE | UNKNOWN} I think that the predicate IS should be calculated before the operator "=". Thus second expression should be equivalent to: It would be reflected in the documentation what the priority of predicates IS [NOT] {TRUE | FALSE | UNKNOWN} |
Modified by: @asfernandessummary: Operator precedence problem when use: NOT <boolean literal> - in complex boolean expression => Precedence problem with operator IS |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 4.0 Alpha 1 [ 10731 ] |
Commented by: @pavel-zotov On WI-T4.0.0.132: select ((not false) is true) is unknown from rdb$database; -- false; OK, expected But: select not false is true is unknown from rdb$database; -- true -- WHY ?? Evaluate from left to right: 1) NOT false ==> TRUE(a), Evaluate from right to left: ----- PS. Fully agree with: > Simonov Denis: |
Commented by: @sim1984 Pavel Zotov, see precedence for operator types above Logical operators calculated after Comparison operators not false is true is unknown => not ((false is true) is unknown) >> "I think that the predicate IS should be calculated before the operator =" Precedence in Postgresql |
Commented by: @asfernandes > select not false is true is unknown from rdb$database; -- true -- WHY ?? Result matches PgSQL too. For the precedence documentation, we do not have a readme for that, so I believe a doc. ticket should be created pointing what doc. is outdated. |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] QA Status: No test => Done successfully |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @dyemanovFix Version: 3.0.1 [ 10730 ] |
Submitted by: @pavel-zotov
1) select (not false = true) is not unknown from rdb$database; -- <true>
2) select not false = true is not unknown from rdb$database; -- <false>
Result of first query is obvious and expected.
But result of second is equal to:
NOT (false = true is not unknown)
It seems that results should be evaluated as: (NOT false) = true is not unknown
Commits: a08f7b8 8a9c5d3
The text was updated successfully, but these errors were encountered: