Skip to content

Commit

Permalink
Fixed sorting on picklist names
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Mar 27, 2024
1 parent a5f0f0a commit 73642dd
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions MarkMpn.Sql4Cds.Engine/ExecutionPlan/SortNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,15 @@ private IDataExecutionPlanNodeInternal FoldSorts(NodeCompilationContext context)

if (attribute != null)
{
if (attribute is LookupAttributeMetadata || useRawOrderBy == true)
return this;

fetchSort.attribute = attribute.LogicalName;
useRawOrderBy = false;

if (attribute is EnumAttributeMetadata || attribute is BooleanAttributeMetadata)
{
if (useRawOrderBy == true)
return this;

useRawOrderBy = false;
}
}
}
}
Expand Down Expand Up @@ -446,11 +450,15 @@ private IDataExecutionPlanNodeInternal FoldSorts(NodeCompilationContext context)

if (attribute != null)
{
if (attribute is LookupAttributeMetadata || useRawOrderBy == true)
return this;

fetchSort.attribute = attribute.LogicalName;
useRawOrderBy = false;

if (attribute is EnumAttributeMetadata || attribute is BooleanAttributeMetadata)
{
if (useRawOrderBy == true)
return this;

useRawOrderBy = false;
}
}
}

Expand Down

0 comments on commit 73642dd

Please sign in to comment.