Skip to content

Commit

Permalink
Merge pull request #1375 from timopollmeier/get_aggregates-fixes-20.08
Browse files Browse the repository at this point in the history
Fix sorting in get_aggregates and its documentation (20.08)
  • Loading branch information
mattmundell authored Dec 8, 2020
2 parents e805fc0 + fb76e9a commit c3857ab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix response memory handling in handle_osp_scan [#1364](https://github.com/greenbone/gvmd/pull/1364)
- Allow config to sync even if NVT family is not available [#1366](https://github.com/greenbone/gvmd/pull/1366)
- Delete report format dirs last when deleting a user [#1368](https://github.com/greenbone/gvmd/pull/1368)
- Fix sorting in get_aggregates and its documentation [#1375](https://github.com/greenbone/gvmd/pull/1375)

### Removed
- Remove DROP from vulns creation [#1281](http://github.com/greenbone/gvmd/pull/1281)
Expand Down
3 changes: 2 additions & 1 deletion src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -5334,7 +5334,8 @@ init_aggregate_iterator (iterator_t* iterator, const char *type,
order_column = g_strdup_printf ("max (aggregate_max_%d)",
index);
else if (strcmp (sort_stat, "mean") == 0)
order_column = g_strdup_printf ("sum (aggregate_avg_%d)",
order_column = g_strdup_printf ("sum (aggregate_sum_%d)"
" / sum(aggregate_count)",
index);
else
order_column = g_strdup_printf ("%s (aggregate_%s_%d)",
Expand Down
8 changes: 4 additions & 4 deletions src/schema_formats/XML/GMP.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -8098,13 +8098,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<summary>Optional tuples of sort criteria</summary>
<pattern>
<attrib>
<name>sort_field</name>
<name>field</name>
<summary>The column to sort the aggregated rows by.
With a subgroup column, groups will be sorted by the group_column first.</summary>
With a subgroup column, groups will be sorted by the group_column first</summary>
<type>text</type>
</attrib>
<attrib>
<name>sort_order</name>
<name>order</name>
<summary>The order to sort by</summary>
<type>
<alts>
Expand All @@ -8114,7 +8114,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</type>
</attrib>
<attrib>
<name>sort_stat</name>
<name>stat</name>
<summary>The statistic to sort the aggregated rows by</summary>
<type>
<alts>
Expand Down

0 comments on commit c3857ab

Please sign in to comment.