Parse aggregate function call: COUNT(var.prop) */
| 1605 | |
| 1606 | /* Parse aggregate function call: COUNT(var.prop) */ |
| 1607 | static int parse_aggregate_item(parser_t *p, cbm_return_item_t *item) { |
| 1608 | cbm_token_type_t ft = peek(p)->type; |
| 1609 | advance(p); |
| 1610 | expect(p, TOK_LPAREN); |
| 1611 | /* Optional DISTINCT inside the call: COUNT(DISTINCT x) (#239). */ |
| 1612 | item->distinct = match(p, TOK_DISTINCT); |
| 1613 | if (match(p, TOK_STAR)) { |
| 1614 | item->variable = heap_strdup("*"); |
| 1615 | } else { |
| 1616 | if (parse_var_dot_prop(p, item) < 0) { |
| 1617 | return CBM_NOT_FOUND; |
| 1618 | } |
| 1619 | } |
| 1620 | expect(p, TOK_RPAREN); |
| 1621 | item->func = heap_strdup(agg_func_name(ft)); |
| 1622 | return 0; |
| 1623 | } |
| 1624 | |
| 1625 | /* Parse string function call: toLower(var.prop) */ |
| 1626 | static int parse_string_func_item(parser_t *p, cbm_return_item_t *item) { |
no test coverage detected