-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Unexpected results when using natural right join #7879
Comments
|
Why do you expect 3 NULL values, that will never happen. Do you understand what a NATURAL JOIN does? To quote from the Language reference:
That means it is equivalent to a join with |
It appears that the second query wrongly returns TRUE then. |
@mrotteveel It's RIGHT join, so the false join condition does not eliminate the rows from the output. |
Firebird v4 returns {3, null} for the third query, while Firebird v5/v6 return no rows. |
IIRC, every unqualified (without an alias) field reference inside a select list of
(in all FB versions) and this:
returns no rows even in v4. |
UNKNOWN OR TRUE is TRUE or more correctly TRUE OR UNKNOWN is TRUE |
See my previous comment, that is the correct result: |
Interestingly enough, the equivalent using SELECT * FROM t0 NATURAL RIGHT JOIN t1 WHERE c0 = any(select c0 from rdb$database union all select c1 from rdb$database); |
Yes, if |
Sure, but IIRC there should be no |
Explained plan shows that |
Should be fixed in the next snapshot (tomorrow). |
Considering the test case below.
The third
SELECT
returns an empty result, which is surprising: If the result of second query istrue
, the value of theIN
expression should be true, and thus the third query should return the row of theJOIN
, that is3 <null>
, same as the first query.I found this in version 6.0.0.154 where I built from source code ab37234
The text was updated successfully, but these errors were encountered: