This is odd, because if I take src/DbLinq/Test/Providers/ReadTest.cs and
change C12_SelectEmployee_MultiJoinWithWhere() to use:
var q = from t in db.Territories
where (t.RegionID > 3 || t.RegionID > 4)
join l in db.EmployeeTerritories on t.TerritoryID equals l.TerritoryID
join e in db.Employees on l.EmployeeID equals e.EmployeeID
select e;
// ...
q.Count()
Then the SqlServer provider generates the SQL:
SELECT COUNT(*)
FROM [dbo].[Territories] AS t$, [dbo].[EmployeeTerritories] AS l
$,
[dbo].[Employees] AS e$
WHERE (t$.[TerritoryID] = l$.[TerritoryID]) AND
(l$.[EmployeeID] = e$.[EmployeeID]) AND
((t$.[RegionID] > 3) OR (t$.[RegionID] > 4))
-- Context: SqlServer Model: AttributedMetaModel Build: 0.19.0.0
Which properly encloses all of the OR's in parenthesis.
Since this works for SqlServer, I imagine that this is actually an
Ingres provider bug, so fixing SqlBuilder.cs is the place to fix it.
Part of the problem is that Ingres isn't regularly tested (no regular
developer has access to Ingres & runs/maintains the unit tests for it).
> Update Issue
>
> I cannot get it to update a field !
This is also odd, and is checked in numerous tests (e.g.
WriteTest.G6_UpdateTableWithStringPK() and
WriteTest.G9_UpdateOnlyChangedProperty() in WriteTest.cs). This may be
another regression in the Ingres provider.
You should see if those unit tests pass for you (though that will
require "porting" test/instnwnd.SqlServer.sql to Ingres, as has been
done forPostgreSQL, Oracle, and SQLite).
- Jon