Skip to content

Commit e90725e

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

models/issues/issue_search.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ 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-
// 9223372036854775807 == max bigint
80+
// Use COALESCE to make sure we sort NULL last regardless of backend DB (9223372036854775807 == max bigint)
8181
sess.OrderBy("COALESCE(label.exclusive_order, 9223372036854775807) ASC").Desc("issue.id")
8282
return
8383
}

0 commit comments

Comments
 (0)