Execute WITH simple (non-aggregate) projection */
| 4837 | |
| 4838 | /* Execute WITH simple (non-aggregate) projection */ |
| 4839 | static void execute_with_simple(cbm_return_clause_t *wc, binding_t *bindings, int bind_count, |
| 4840 | binding_t *vbindings, int *vcount) { |
| 4841 | for (int bi = 0; bi < bind_count; bi++) { |
| 4842 | binding_t vb = {0}; |
| 4843 | vb.store = bindings[bi].store; /* so node_prop can re-fetch / compute on the projection */ |
| 4844 | for (int ci = 0; ci < wc->count; ci++) { |
| 4845 | char name_buf[CBM_SZ_256]; |
| 4846 | const char *alias = resolve_item_alias(&wc->items[ci], name_buf, sizeof(name_buf)); |
| 4847 | const cbm_node_t *carried = with_item_carried_node(&wc->items[ci], &bindings[bi]); |
| 4848 | if (carried) { |
| 4849 | binding_set(&vb, with_item_node_alias(&wc->items[ci]), carried); |
| 4850 | continue; |
| 4851 | } |
| 4852 | char func_buf[CBM_SZ_512]; |
| 4853 | const char *val = |
| 4854 | project_item(&bindings[bi], &wc->items[ci], func_buf, sizeof(func_buf)); |
| 4855 | with_add_vbinding_var(&vb, alias, val); |
| 4856 | } |
| 4857 | vbindings[(*vcount)++] = vb; |
| 4858 | } |
| 4859 | } |
| 4860 | |
| 4861 | static void with_sink_feed(with_sink_t *s, binding_t *bindings, int bind_count) { |
| 4862 | if (bind_count > 0 && !s->fed_any) { |
no test coverage detected