Skip to content

Commit 25c0718

Browse files
committed
Use COALESCE to make sure nulls are last regardless of DB.
1 parent d0faa52 commit 25c0718

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

models/issues/issue_search.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ func applySorts(sess *xorm.Session, sortType string, priorityRepoID int64) {
7777
scope := strings.TrimPrefix(sortType, ScopeSortPrefix)
7878
sess.Join("LEFT", "issue_label", "issue.id = issue_label.issue_id")
7979
sess.Join("LEFT", "label", "label.id = issue_label.label_id and label.name LIKE ?", scope+"/%")
80-
sess.Asc("label.exclusive_order").Desc("issue.id")
80+
// 9223372036854775807 == max bigint
81+
sess.OrderBy("COALESCE(label.exclusive_order, 9223372036854775807) ASC").Desc("issue.id")
8182
return
8283
}
8384

0 commit comments

Comments
 (0)