Parse aggregate function call: COUNT(var.prop) */
| 1635 | |
| 1636 | /* Parse aggregate function call: COUNT(var.prop) */ |
| 1637 | static int parse_aggregate_item(parser_t *p, cbm_return_item_t *item) { |
| 1638 | cbm_token_type_t ft = peek(p)->type; |
| 1639 | advance(p); |
| 1640 | expect(p, TOK_LPAREN); |
| 1641 | /* Optional DISTINCT inside the call: COUNT(DISTINCT x) (#239). */ |
| 1642 | item->distinct = match(p, TOK_DISTINCT); |
| 1643 | if (match(p, TOK_STAR)) { |
| 1644 | item->variable = heap_strdup("*"); |
| 1645 | } else { |
| 1646 | if (parse_var_dot_prop(p, item) < 0) { |
| 1647 | return CBM_NOT_FOUND; |
| 1648 | } |
| 1649 | } |
| 1650 | expect(p, TOK_RPAREN); |
| 1651 | item->func = heap_strdup(agg_func_name(ft)); |
| 1652 | return 0; |
| 1653 | } |
| 1654 | |
| 1655 | /* Parse string function call: toLower(var.prop) */ |
| 1656 | static int parse_string_func_item(parser_t *p, cbm_return_item_t *item) { |
no test coverage detected