Skip to content

Commit

Permalink
Fixed cross-entity column comparisons using <> and IS NOT DISTINCT FROM
Browse files Browse the repository at this point in the history
Fixes #486
  • Loading branch information
MarkMpn committed Jun 18, 2024
1 parent 5c3f108 commit d96542b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions MarkMpn.Sql4Cds.Engine/ExecutionPlan/BaseDataNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,8 @@ private bool TranslateFetchXMLCriteria(NodeCompilationContext context, DataSourc
},
new condition
{
entityname = StandardizeAlias(entityAlias, targetEntityAlias, items),
attribute = RemoveAttributeAlias(attrName2, entityAlias, targetEntityAlias, items),
entityname = StandardizeAlias(entityAlias2, targetEntityAlias, items),
attribute = RemoveAttributeAlias(attrName2, entityAlias2, targetEntityAlias, items),
@operator = @operator.notnull
}
}
Expand All @@ -611,7 +611,7 @@ private bool TranslateFetchXMLCriteria(NodeCompilationContext context, DataSourc
else if (op == @operator.eq && type == BooleanComparisonType.IsNotDistinctFrom)
{
// FetchXML eq operator does not match records where both fields are null.
// This matches the logic for =, but IS DISTINCT FROM also allows nulls to match
// This matches the logic for =, but IS NOT DISTINCT FROM also allows nulls to match
filter = new filter
{
type = filterType.or,
Expand All @@ -631,8 +631,8 @@ private bool TranslateFetchXMLCriteria(NodeCompilationContext context, DataSourc
},
new condition
{
entityname = StandardizeAlias(entityAlias, targetEntityAlias, items),
attribute = RemoveAttributeAlias(attrName2, entityAlias, targetEntityAlias, items),
entityname = StandardizeAlias(entityAlias2, targetEntityAlias, items),
attribute = RemoveAttributeAlias(attrName2, entityAlias2, targetEntityAlias, items),
@operator = @operator.@null
}
}
Expand Down

0 comments on commit d96542b

Please sign in to comment.