Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort missing severity as lowest value in GMP get #1508

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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