Skip to content
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

Incorrect LEFT JOIN result using table and derived constant subquery [CORE3090] #3469

Closed
firebird-issue-importer opened this issue Jul 30, 2010 · 9 comments

Comments

@firebird-issue-importer

Submitted by: Smirnoff Serg (wildsery)

Relate to CORE3176
Relate to CORE3173
Is related to QA443

Votes: 2

Test case:

recreate table test_err (id int);
insert into test_err (ID) values (1);
insert into test_err (ID) values (2);

select *
from test_err t
left join (select 1 id from rdb$database) a on http://a.id = http://t.id;

Result must be
ID ID
============ ============
1 1
2 <null>

But, result is
ID ID
============ ============
1 <null>
2 <null>

However, the second LEFT JOIN works fine
select *
from test_err t
left join (select 1 id from rdb$database) a on http://a.id = http://t.id
left join (select 2 id from rdb$database) b on http://b.id = http://t.id;

      ID           ID           ID

============ ============ ============
1 <null> <null>
2 <null> 2

Commits: 70ad7ef a539537 7f3dc62 ea94b62

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 30, 2010

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 6, 2010

Commented by: Thomas Beckmann (thbeckmann)

This might be due to the same reason:

"select
RESULT
from (select
'Well' as RESULT
from (select
'Works' as D
from RDB$DATABASE d) i
left join RDB$DATABASE on 1=0) j
left join RDB$DATABASE on 1=0"

returns 'well' - which is fine with me.

But

"select
RESULT
from (select
'Well' as RESULT
from (select
(select 'Does not work' from RDB$DATABASE) as D
from RDB$DATABASE d) i
left join RDB$DATABASE on 1=0) j
left join RDB$DATABASE on 1=0"

returns nothing - which I am pretty sure, is a bug...

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 7, 2010

Commented by: @asfernandes

Please test the next 2.5 snapshot build.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 7, 2010

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5.0 [ 10221 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 13, 2010

Modified by: @dyemanov

Link: This issue relate to CORE3176 [ CORE3176 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 20, 2011

Modified by: @dyemanov

Link: This issue relate to CORE3173 [ CORE3173 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 24, 2011

Modified by: @pcisar

Link: This issue is related to QA443 [ QA443 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 20, 2011

Modified by: @pmakowski

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 20, 2015

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants