Skip to content

Commit 7f815a7

Browse files
mattmundellgreenbonebot
authored andcommitted
Fix: require group col when subgroup col is given in GET_AGGREGATES
The point of the subgroup column is to refine the group column. The XML response was broken anyway, when subgroup column was sent without the group column.
1 parent e1707ac commit 7f815a7

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/gmp.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11948,6 +11948,17 @@ handle_get_aggregates (gmp_parser_t *gmp_parser, GError **error)
1194811948
group_column = get_aggregates_data->group_column;
1194911949
subgroup_column = get_aggregates_data->subgroup_column;
1195011950

11951+
if (subgroup_column && group_column == NULL)
11952+
{
11953+
SEND_TO_CLIENT_OR_FAIL
11954+
(XML_ERROR_SYNTAX ("get_aggregates",
11955+
"A 'group_column' attribute is required when"
11956+
" 'subgroup_column' is given"));
11957+
get_aggregates_data_reset (get_aggregates_data);
11958+
set_client_state (CLIENT_AUTHENTIC);
11959+
return;
11960+
}
11961+
1195111962
init_aggregate_lists (group_column,
1195211963
subgroup_column,
1195311964
get_aggregates_data->data_columns,

0 commit comments

Comments
 (0)