Skip to content

Commit

Permalink
Merge pull request #1508 from timopollmeier/missing-severity-sorting
Browse files Browse the repository at this point in the history
Sort missing severity as lowest value in GMP get
  • Loading branch information
nichtsfrei authored Apr 29, 2021
2 parents 01e1bc0 + 89c4142 commit 8dce2c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- Improve report counts performance [#1438](https://github.com/greenbone/gvmd/pull/1438)
- Clean up log config, add gvm-libs log domains [#1502](https://github.com/greenbone/gvmd/pull/1502)
- Sort missing severity as lowest value in GMP get [#1508](https://github.com/greenbone/gvmd/pull/1508)

### Fixed
- Also create owner WITH clause for single resources [#1406](https://github.com/greenbone/gvmd/pull/1406)
Expand Down
12 changes: 8 additions & 4 deletions src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -3025,8 +3025,10 @@ filter_clause (const char* type, const char* filter,
keyword->string);
g_string_append_printf (order,
" ORDER BY CASE CAST (%s AS text)"
" WHEN '' THEN NULL"
" ELSE CAST (%s AS REAL) END ASC",
" WHEN '' THEN '-Infinity'::real"
" ELSE coalesce(%s::real,"
" '-Infinity'::real)"
" END ASC",
column,
column);
}
Expand Down Expand Up @@ -3215,8 +3217,10 @@ filter_clause (const char* type, const char* filter,
keyword->string);
g_string_append_printf (order,
" ORDER BY CASE CAST (%s AS text)"
" WHEN '' THEN NULL"
" ELSE CAST (%s AS REAL) END DESC",
" WHEN '' THEN '-Infinity'::real"
" ELSE coalesce(%s::real,"
" '-Infinity'::real)"
" END DESC",
column,
column);
}
Expand Down

0 comments on commit 8dce2c6

Please sign in to comment.