]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3825 fix compatibility with Oracle
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 11 Dec 2012 11:06:37 +0000 (12:06 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 11 Dec 2012 11:06:37 +0000 (12:06 +0100)
sonar-core/src/main/java/org/sonar/core/measure/MeasureFilterSql.java

index 54b0d00a0074e1272b51c057fd38bd38581dbf23..21a99ef519798b50ab9561a06fecb51d43aba9fb 100644 (file)
@@ -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");
     }
   }