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
CREATETABLEt0(c0 INT);
CREATETABLEt1(c0 INT);
INSERT INTO t0(c0) VALUES (0);
INSERT INTO t1(c0) VALUES (0);
SELECT*FROM t1, t0 WHERE NOT ((t1.c0ANDt0.c0) <0); -- expected: {0|0}, actual: {}
Unexpectedly, the query does not fetch a row. The predicate should evaluate to TRUE for the rows in t0, and t1. The negated predicate works as expected and does not fetch any rows:
SELECT*FROM t1, t0 WHERE ((t1.c0ANDt0.c0) <0); -- {}
I found htis based on the latest commit to master (9795d18).
The text was updated successfully, but these errors were encountered:
Fixed this in d88e21d. The issue was that in the planning of a join with an expression in the form of NOT(comparison) we tried to invert the underlying comparison, e.g. NOT(x < 0) is equivalent to x >= 0. The problem is that we did this, then tried to split the comparison into a left and right side, and if this did not succeed we did not properly revert the comparison.
In this query what it would mean is the following:
-- original expression
NOT((t1.c0ANDt0.c0) <0)
-- transform into:
(t1.c0ANDt0.c0) >=0-- cannot divide into left/right side! treat as arbitrary expression
NOT((t1.c0ANDt0.c0) >=0) -- <= BUG!
I now moved this inversion of the NOT to the parser, so the parser would already invert NOT(x <y) to x>=y. This also makes the code cleaner in general :)
Consider the following statements:
Unexpectedly, the query does not fetch a row. The predicate should evaluate to
TRUE
for the rows in t0, and t1. The negated predicate works as expected and does not fetch any rows:I found htis based on the latest commit to master (9795d18).
The text was updated successfully, but these errors were encountered: