From: Simon Brandhof Date: Tue, 11 Dec 2012 11:06:37 +0000 (+0100) Subject: SONAR-3825 fix compatibility with Oracle X-Git-Tag: 3.4~59 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d511d8c008b393c6cd0af67cbe18db760667c6f4;p=sonarqube.git SONAR-3825 fix compatibility with Oracle --- diff --git a/sonar-core/src/main/java/org/sonar/core/measure/MeasureFilterSql.java b/sonar-core/src/main/java/org/sonar/core/measure/MeasureFilterSql.java index 54b0d00a007..21a99ef5197 100644 --- a/sonar-core/src/main/java/org/sonar/core/measure/MeasureFilterSql.java +++ b/sonar-core/src/main/java/org/sonar/core/measure/MeasureFilterSql.java @@ -99,11 +99,9 @@ class MeasureFilterSql { } } if (filter.sort().isSortedByDatabase()) { - if (filter.sort().isAsc()) { - sql.append(" ORDER BY sortval"); - } else { - sql.append(" ORDER BY CASE WHEN max(sortval) IS NULL THEN 1 ELSE 0 END, sortval DESC"); - } + sql.append(" ORDER BY sortval "); + sql.append(filter.sort().isAsc() ? "ASC" : "DESC"); + sql.append(" NULLS LAST"); } }