Skip to content

Commit

Permalink
Fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Jun 20, 2024
1 parent 0567793 commit 1d39bf8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MarkMpn.Sql4Cds.Engine/ExecutionPlan/FetchXmlScan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ private void AddNotNullFilters(ColumnList schema, Dictionary<string, IReadOnlyLi

private void AddSchemaAttribute(DataSource dataSource, ColumnList schema, Dictionary<string, IReadOnlyList<string>> aliases, string fullName, string simpleName, DataTypeReference type, EntityMetadata entityMetadata, AttributeMetadata attrMetadata, bool innerJoin)
{
var notNull = innerJoin && (attrMetadata.LogicalName == entityMetadata.PrimaryIdAttribute);
var notNull = innerJoin && attrMetadata.LogicalName == entityMetadata.PrimaryIdAttribute;

// Add the logical attribute
AddSchemaAttribute(schema, aliases, fullName, simpleName, type, notNull);
Expand Down
6 changes: 3 additions & 3 deletions MarkMpn.Sql4Cds.Engine/ExecutionPlan/FilterNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -620,14 +620,14 @@ private void ConvertOuterJoinsWithNonNullFiltersToInnerJoins(NodeCompilationCont

private void ConvertOuterJoinsWithNonNullFiltersToInnerJoins(NodeCompilationContext context, IDataExecutionPlanNodeInternal source, List<string> notNullColumns)
{
if (source is BaseJoinNode join)
if (source is BaseJoinNode join && !join.SemiJoin)
{
IDataExecutionPlanNodeInternal outerSource = null;

if (join.JoinType == QualifiedJoinType.LeftOuter)
outerSource = join.RightSource;
outerSource = join.OutputRightSchema ? join.RightSource : null;
else if (join.JoinType == QualifiedJoinType.RightOuter)
outerSource = join.LeftSource;
outerSource = join.OutputLeftSchema ? join.LeftSource : null;

if (outerSource != null)
{
Expand Down

0 comments on commit 1d39bf8

Please sign in to comment.