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 results when left join on subquery with constant column [CORE1000] #1411

Closed
firebird-automations opened this issue Nov 14, 2006 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Jeffrey Clement (jclement)

Is related to QA326

There seems to be a problem with the optimizer and joins to subqueries with static columns. That probably didn't actually resemble english so here goes...

Two tables:

CREATE TABLE A (
ID INTEGER
);

CREATE TABLE B (
ID INTEGER
);

Table A has values (1,2,3)
Table B has values (1,2)

Now I run the following query:

select
http://a.id,
http://b.id,
bexists
from
a
left join (select id, 1 bexists from b) b on (http://a.id=b.id)

What I expect to see is:
http://a.ID, http://b.ID, bExists
1,1,1
2,2,1
3,null,null

However what I get back is
http://a.ID, http://b.ID, bExists
1,1,1
2,2,1
3,null,1

This doesn't seem right.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Arno Brinkman [ arnobrinkman ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 11316 ] => Firebird [ 15398 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Arno Brinkman [ arnobrinkman ] => Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

This ticket duplicates other one(s) resolved by Adriano in v2.5.
I've verified the test case vs v2.5 RC1 and everything works correctly now.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 Beta 2 [ 10300 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Link: This issue is related to QA326 [ QA326 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pcisar

QA test added.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test => Done successfully

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

No branches or pull requests

2 participants