Exception "Column unknown" in JOIN
----------------------------------
Key: CORE-5400
URL: http://tracker.firebirdsql.org/browse/CORE-5400
Project: Firebird Core
Issue Type: Bug
Affects Versions: 3.0.1
Environment: Firebird 3.0.1 Windows
Reporter: Tomasz Kujalow
Priority: Critical
I have simple join:
select FJ.indeks
from faktury_jednostki FJ, faktury F, fin_rodzaje_dokumentow FRD
left join faktury_zadania FZ on FZ.id_faktury_jednostki = FJ.indeks
where F.indeks = FJ.id_faktury
and F.id_fin_rodzaje_dokumentow = FRD.indeks
After call, I got exception:
Column does not belong to referenced table.
Dynamic SQL Error.
SQL error code = -206.
Column unknown.
FJ.INDEKS.
At line 3, column 59.
BUT ! If I change position in FROM (move faktury_jednostki FJ to end) there is
NOT exception:
select FJ.indeks
from faktury F, fin_rodzaje_dokumentow FRD, faktury_jednostki FJ
left join faktury_zadania FZ on FZ.id_faktury_jednostki = FJ.indeks
where F.indeks = FJ.id_faktury
and F.id_fin_rodzaje_dokumentow = FRD.indeks
In Firebird 2.5.x there was not such exception.
My objects:
CREATE TABLE FAKTURY_ZADANIA (
INDEKS INTEGER NOT NULL,
...
ID_FAKTURY_JEDNOSTKI INTEGER,
...
);
ALTER TABLE FAKTURY_ZADANIA ADD CONSTRAINT PK_FAKTURY_ZADANIA PRIMARY KEY
(INDEKS);
ALTER TABLE FAKTURY_ZADANIA ADD CONSTRAINT FK_FAKTURY_ZADANIA_22 FOREIGN KEY
(ID_FAKTURY_JEDNOSTKI) REFERENCES FAKTURY_JEDNOSTKI (INDEKS) ON DELETE CASCADE;
CREATE TABLE FAKTURY_JEDNOSTKI (
INDEKS INTEGER NOT NULL,
ID_FAKTURY INTEGER NOT NULL,
...
);
ALTER TABLE FAKTURY_JEDNOSTKI ADD CONSTRAINT PK_FAKTURY_JEDNOSTKI PRIMARY KEY
(INDEKS);
ALTER TABLE FAKTURY_JEDNOSTKI ADD CONSTRAINT FK_FAKTURY_JEDNOSTKI_1 FOREIGN KEY
(ID_FAKTURY) REFERENCES FAKTURY (INDEKS) ON DELETE CASCADE;
CREATE TABLE FIN_RODZAJE_DOKUMENTOW (
INDEKS INTEGER NOT NULL,
...
);
ALTER TABLE FIN_RODZAJE_DOKUMENTOW ADD CONSTRAINT PK_FIN_RODZAJE_DOKUMENTOW
PRIMARY KEY (INDEKS);
CREATE TABLE FAKTURY (
INDEKS INTEGER NOT NULL,
...
ID_FIN_RODZAJE_DOKUMENTOW INTEGER NOT NULL,
...
);
ALTER TABLE FAKTURY ADD CONSTRAINT FAKTURY_CONSTR_1 PRIMARY KEY (INDEKS);
ALTER TABLE FAKTURY ADD CONSTRAINT FK_FAKTURY_12 FOREIGN KEY
(ID_FIN_RODZAJE_DOKUMENTOW) REFERENCES FIN_RODZAJE_DOKUMENTOW (INDEKS);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel