Fixed handling of nulls with sort_by expressions #2164

This commit is contained in:
Mike Farah
2024-11-16 12:27:18 +11:00
parent f238f01856
commit 4af292f076
2 changed files with 13 additions and 1 deletions
+2 -1
View File
@@ -69,6 +69,7 @@ func (a sortableNodeArray) Less(i, j int) bool {
rhsContext := a[j].CompareContext
rhsEl := rhsContext.MatchingNodes.Front()
for lhsEl := lhsContext.MatchingNodes.Front(); lhsEl != nil && rhsEl != nil; lhsEl = lhsEl.Next() {
lhs := lhsEl.Value.(*CandidateNode)
rhs := rhsEl.Value.(*CandidateNode)
@@ -83,7 +84,7 @@ func (a sortableNodeArray) Less(i, j int) bool {
rhsEl = rhsEl.Next()
}
return false
return lhsContext.MatchingNodes.Len() < rhsContext.MatchingNodes.Len()
}
func (a sortableNodeArray) compare(lhs *CandidateNode, rhs *CandidateNode, dateTimeLayout string) int {