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

RC1 - Left Join work like Inner Join [CORE281] #612

Closed
firebird-automations opened this issue Dec 26, 2001 · 2 comments
Closed

RC1 - Left Join work like Inner Join [CORE281] #612

firebird-automations opened this issue Dec 26, 2001 · 2 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: skopalik (skopalik)

Assigned to: @samofatov

SFID: 496784#⁠
Submitted By: skopalik

When optimizer find indexies for Left Join,
work like Inner Join.
There is sql example:

CREATE DATABASE "localhost:d:\ibdata\test.gdb"
USER "sysdba" PASSWORD "masterkey";

Create table Operace (
idProducts integer NOT NULL,
idNextDev Smallint,
Primary Key (idProducts)
);

Create table Devices (
id Smallint NOT NULL,
Primary Key (id)
);

Create table Products (
id integer NOT NULL,
Primary Key (id)
);

Alter table Operace add foreign key (idProducts)
references Products (id) on update no action on
delete no action ;

insert into devices(id) values(0);
insert into devices(id) values(1);
insert into products values(0);
insert into products values(1);
insert into operace values(0,1);
insert into operace values(1,1);

/* This query is correct */
select *
from OPERACE O
join PRODUCTS P on P.ID=O.IDPRODUCTS
left join DEVICES D on D.ID=O.IDNEXTDEV+0 and D.ID=0;

/* This query failed */
select *
from OPERACE O
join PRODUCTS P on P.ID=O.IDPRODUCTS
left join DEVICES D on D.ID=O.IDNEXTDEV and D.ID=0;

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 10305 ] => Firebird [ 14543 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

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

1 participant