Project RETURN * — all bound variable properties */ Collect all variable names from query patterns */
| 3807 | /* Project RETURN * — all bound variable properties */ |
| 3808 | /* Collect all variable names from query patterns */ |
| 3809 | static int collect_pattern_vars(cbm_query_t *q, const char **vars, int max_vars) { |
| 3810 | int vc = 0; |
| 3811 | for (int pi = 0; pi < q->pattern_count; pi++) { |
| 3812 | for (int ni = 0; ni < q->patterns[pi].node_count && vc < max_vars; ni++) { |
| 3813 | if (q->patterns[pi].nodes[ni].variable) { |
| 3814 | vars[vc++] = q->patterns[pi].nodes[ni].variable; |
| 3815 | } |
| 3816 | } |
| 3817 | for (int ri = 0; ri < q->patterns[pi].rel_count && vc < max_vars; ri++) { |
| 3818 | if (q->patterns[pi].rels[ri].variable) { |
| 3819 | vars[vc++] = q->patterns[pi].rels[ri].variable; |
| 3820 | } |
| 3821 | } |
| 3822 | } |
| 3823 | return vc; |
| 3824 | } |
| 3825 | |
| 3826 | /* Build star-projection columns: var.name, var.qualified_name, var.label, var.file_path */ |
| 3827 | static void build_star_columns(result_builder_t *rb, const char **vars, int vc) { |
no outgoing calls
no test coverage detected