diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-12-11 17:27:07 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-12-11 17:27:07 +0100 |
commit | bc68a80e852b3de02853e24beaa3ac29ccc21729 (patch) | |
tree | a182e7e09d5a9ad6e6692a111498a5e105ed466c /sonar-core | |
parent | d0a51bd2596e1766539c72cab4d909747eea0eaa (diff) | |
download | sonarqube-bc68a80e852b3de02853e24beaa3ac29ccc21729.tar.gz sonarqube-bc68a80e852b3de02853e24beaa3ac29ccc21729.zip |
SONAR-3825 try to fix descending sort of numeric values on SQLServer...
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/measure/MeasureFilterSql.java | 6 |
1 files changed, 3 insertions, 3 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 0da49a1f0f2..3708bccae4a 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 @@ -75,7 +75,7 @@ class MeasureFilterSql { } private void init() { - sql.append("SELECT block.id, max(block.rid) AS rid, max(block.rootid) AS rootid, max(sortval) AS sortval1, CASE WHEN sortval IS NULL THEN 1 ELSE 0 END AS sortval2 "); + sql.append("SELECT block.id, max(block.rid) AS rid, max(block.rootid) AS rootid, max(sortval) AS sortvalmax, CASE WHEN sortval IS NULL THEN 1 ELSE 0 END AS sortflag "); for (int index = 0; index < filter.getMeasureConditions().size(); index++) { sql.append(", max(crit_").append(index).append(")"); } @@ -88,7 +88,7 @@ class MeasureFilterSql { appendConditionBlock(index, condition); } - sql.append(") block GROUP BY block.id, sortval2"); + sql.append(") block GROUP BY block.id, sortflag"); if (!filter.getMeasureConditions().isEmpty()) { sql.append(" HAVING "); for (int index = 0; index < filter.getMeasureConditions().size(); index++) { @@ -99,7 +99,7 @@ class MeasureFilterSql { } } if (filter.sort().isSortedByDatabase()) { - sql.append(" ORDER BY sortval2 ASC, sortval1 "); + sql.append(" ORDER BY sortflag ASC, sortvalmax "); sql.append(filter.sort().isAsc() ? "ASC " : "DESC "); } } |