From d511d8c008b393c6cd0af67cbe18db760667c6f4 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 11 Dec 2012 12:06:37 +0100 Subject: [PATCH] SONAR-3825 fix compatibility with Oracle --- .../java/org/sonar/core/measure/MeasureFilterSql.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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"); } } -- 2.39.5