You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected result when querying with boolean comparisons #16227
Consider the following test case. A discrepancy is observed when filtering results using a boolean comparison in a WHERE clause. The boolean condition (((t1.c0 != t1.c0)>(t0.c0 = t0.c0)) = t1.c0) evaluates to TRUE when selected directly, but fails to return any rows when used in the WHERE clause.
Activity
BaurzhanSakhariev commentedon Jun 25, 2024
Thanks for reporting @suyZhong!
It's indeed related to #16173 (same root cause).
Workaround: disable hash join by
SET enable_hashjoin = false.https://www.db-fiddle.com/f/iTmq9KnYViJiQdG6yGWEEb/0
PG uses NestedLoopJoin (note casts of int to boolean, CrateDB does that implicitly).
Another one false positive HashJoin detection, #16200 needs a follow up (probably can use the same change entry but rephrase it).