-
Notifications
You must be signed in to change notification settings - Fork 147
Closed
Description
Description
I am encountering a problem with the (!!)
operator when used on a non-FK join (related: #590).
The following code compiles and runs fime:
query {
for c in ctx.Dbo.Card do
join lio in ctx.Dbo.LastInOut on (c.CdCardNumber = lio.LioCardNumber)
join ac in ctx.Dbo.AccessControl on (c.CdCardNumber = ac.AcCardNumber)
join pLio in (!!) ctx.Dbo.Project on (lio.LioProjectId = pLio.PrId)
for pAc in ac.``dbo.Project by prId`` do
select 0
}
However, if I switch the join pLio
and for pAc
lines, I get a runtime error (compiles fine):
query {
for c in ctx.Dbo.Card do
join lio in ctx.Dbo.LastInOut on (c.CdCardNumber = lio.LioCardNumber)
join ac in ctx.Dbo.AccessControl on (c.CdCardNumber = ac.AcCardNumber)
for pAc in ac.``dbo.Project by prId`` do
join pLio in (!!) ctx.Dbo.Project on (lio.LioProjectId = pLio.PrId)
select 0
}
System.Exception: Unknown: _arg1.Item3.get_DataContext().CreateRelated(_arg1.Item3, "FK_AccessControl_Project", "dbo.Project", "prId", "dbo.AccessControl", "acProjectId", Parents).Join(op_BangBang(Convert(Convert(Convert(FSI_0002.ctx)).CreateEntities("dbo.Project"))), pAc => _arg1.Item2.GetColumn("lioProjectId"), pLio => pLio.GetColumn("prId"), (pAc, pLio) => new AnonymousObject`5(Item1 = _arg1.Item1, Item2 = _arg1.Item2, Item3 = _arg1.Item3, Item4 = pAc, Item5 = pLio))
at Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation(FSharpExpr e)
at Microsoft.FSharp.Linq.QueryModule.EvalNonNestedInner(CanEliminate canElim, FSharpExpr queryProducingSequence)
at Microsoft.FSharp.Linq.QueryModule.clo@1727-1.Microsoft-FSharp-Linq-ForwardDeclarations-IQueryMethods-Execute[a,b](FSharpExpr`1 q)
at <StartupCode$FSI_0045>.$FSI_0045.main@()
I don't know what more information I can provide. Let me know if you need anything. Unfortunately I have no idea how to create a minimal, isolated repro since this is dependent on our DB schema.
Known workarounds
Change the order of the lines (though I can't guarantee this is possible for all cases).
Related information
- MSSQL
- SQLProvider 1.1.62
- FSI (referencing net451 version of SQLProvider)
Metadata
Metadata
Assignees
Labels
No labels