Add element DATA_TYPE back to element AGGREGATE in GMP GET_AGGREGATES.
Why
Element was accidentally removed.
References
This element was removed in d73fba850fbbb26927f6ab6070a01e2738dcbbd5 (SVN r23003) in 2015. In omp.c line 16809 was removed from omp_xml_handle_end_element but was missing from the addition buffer_aggregate_xml at line 11416.
It looks like this was an accident because the element is still in the GMP doc, and the removal would likely have been mentioned in the commit log. Let me know if this was intentional though, I'll adjust the doc instead.
Note that the original had a type NULL check before the g_string_append_printf, but type is already checked at the top of handle_get_aggregates.
Quick test
Before PR:
$ o m m '<get_aggregates type="cve" group_column="severity"/>'
<get_aggregates_response status_text="OK" status="200">
<aggregate>
<group_column>severity</group_column>
$ o m m '<get_aggregates type="result" group_column="description" mode="word_counts" max_groups="10"/>'
<get_aggregates_response status_text="OK" status="200">
<aggregate>
<group_column>description</group_column>
After PR, element data_type is back:
$ o m m '<get_aggregates type="cve" group_column="severity"/>'
<get_aggregates_response status_text="OK" status="200">
<aggregate>
<data_type>cve</data_type>
<group_column>severity</group_column>
$ o m m '<get_aggregates type="result" group_column="description" mode="word_counts" max_groups="10"/>'
<get_aggregates_response status_text="OK" status="200">
<aggregate>
<data_type>result</data_type>
<group_column>description</group_column>
```<hr>This is an automatic backport of pull request #2236 done by [Mergify](https://mergify.com).
What
Add element
DATA_TYPE
back to elementAGGREGATE
in GMPGET_AGGREGATES
.Why
Element was accidentally removed.
References
This element was removed in d73fba850fbbb26927f6ab6070a01e2738dcbbd5 (SVN r23003) in 2015. In omp.c line 16809 was removed from
omp_xml_handle_end_element
but was missing from the additionbuffer_aggregate_xml
at line 11416.It looks like this was an accident because the element is still in the GMP doc, and the removal would likely have been mentioned in the commit log. Let me know if this was intentional though, I'll adjust the doc instead.
Note that the original had a
type
NULL check before theg_string_append_printf
, buttype
is already checked at the top ofhandle_get_aggregates
.Quick test
Before PR:
After PR, element
data_type
is back: