| 549 | } |
| 550 | |
| 551 | bool AST_ClauseContainsAggregation |
| 552 | ( |
| 553 | const cypher_astnode_t *clause |
| 554 | ) { |
| 555 | ASSERT(clause); |
| 556 | |
| 557 | bool aggregated = false; |
| 558 | |
| 559 | // Retrieve all user-specified functions in clause. |
| 560 | rax *referred_funcs = raxNew(); |
| 561 | AST_ReferredFunctions(clause, referred_funcs); |
| 562 | |
| 563 | char funcName[32]; |
| 564 | raxIterator it; |
| 565 | _prepareIterateAll(referred_funcs, &it); |
| 566 | while(raxNext(&it)) { |
| 567 | size_t len = it.key_len; |
| 568 | ASSERT(len < 32); |
| 569 | // Copy the triemap key so that we can safely add a terinator character |
| 570 | memcpy(funcName, it.key, len); |
| 571 | funcName[len] = 0; |
| 572 | |
| 573 | if(AR_FuncIsAggregate(funcName)) { |
| 574 | aggregated = true; |
| 575 | break; |
| 576 | } |
| 577 | } |
| 578 | raxStop(&it); |
| 579 | raxFree(referred_funcs); |
| 580 | |
| 581 | return aggregated; |
| 582 | } |
| 583 | |
| 584 | const char **AST_BuildReturnColumnNames |
| 585 | ( |
no test coverage detected