Parse aggregate function call: COUNT(var.prop) */
| 1471 | |
| 1472 | /* Parse aggregate function call: COUNT(var.prop) */ |
| 1473 | static int parse_aggregate_item(parser_t *p, cbm_return_item_t *item) { |
| 1474 | cbm_token_type_t ft = peek(p)->type; |
| 1475 | advance(p); |
| 1476 | expect(p, TOK_LPAREN); |
| 1477 | /* Optional DISTINCT inside the call: COUNT(DISTINCT x) (#239). */ |
| 1478 | item->distinct = match(p, TOK_DISTINCT); |
| 1479 | if (match(p, TOK_STAR)) { |
| 1480 | item->variable = heap_strdup("*"); |
| 1481 | } else { |
| 1482 | if (parse_var_dot_prop(p, item) < 0) { |
| 1483 | return CBM_NOT_FOUND; |
| 1484 | } |
| 1485 | } |
| 1486 | expect(p, TOK_RPAREN); |
| 1487 | item->func = heap_strdup(agg_func_name(ft)); |
| 1488 | return 0; |
| 1489 | } |
| 1490 | |
| 1491 | /* Parse string function call: toLower(var.prop) */ |
| 1492 | static int parse_string_func_item(parser_t *p, cbm_return_item_t *item) { |
no test coverage detected