-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Hi,
given the following Tables:
CREATE TABLE TestA
(
ID INTEGER PRIMARY KEY,
Txt TEXT
);
CREATE TABLE TestB
(
ID INTEGER PRIMARY KEY,
Aref INTEGER,
Txt TEXT,
FOREIGN KEY(Aref) REFERENCES TestA(ID)
);
INSERT INTO TestA
VALUES (1, 'This is Test A!');
INSERT INTO TestB
VALUES (1, 1, 'This is TestB!');
This line fails:
db["TestB"].Find(db["TestB"]["TestA"]["ID"] == db["TestB"]["Aref"])
The generated SQL statement:
select [TestB].* from [TestB] JOIN [TestA] ON ([TestA].[Aref] = [TestB].[ID]) where [TestA].[ID] = [TestB].[Aref]
As far as I can tell the tables in the ON part are inverted.
I tested it with: Simple.Data.Core/Ado v0.12.2.2 and Simple.Data.Sqlite v0.12.2.4.
I also checked the behavior of the sqlserver which is doing it right.
Metadata
Metadata
Assignees
Labels
No labels