Skip to content

Commit

Permalink
Fixed nested loop left outer join with no records returned from inner…
Browse files Browse the repository at this point in the history
… source
  • Loading branch information
MarkMpn committed Oct 3, 2023
1 parent 8673a6a commit 9520643
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions MarkMpn.Sql4Cds.Engine/ExecutionPlan/NestedLoopNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,17 @@ protected override IEnumerable<Entity> ExecuteInternal(NodeExecutionContext cont
}

if (!hasRight && JoinType == QualifiedJoinType.LeftOuter)
{
if (rightSchema == null)
{
rightSchema = RightSource.GetSchema(rightCompilationContext);
mergedSchema = GetSchema(context, true);
joinCondition = JoinCondition?.Compile(new ExpressionCompilationContext(context, mergedSchema, null));
joinConditionContext = joinCondition == null ? null : new ExpressionExecutionContext(context);
}

yield return Merge(left, leftSchema, null, rightSchema);
}
}
}

Expand Down

0 comments on commit 9520643

Please sign in to comment.