Build default 3-column headers (name, qualified_name, label) per variable */
| 4479 | |
| 4480 | /* Build default 3-column headers (name, qualified_name, label) per variable */ |
| 4481 | static void build_default_columns(result_builder_t *rb, const char **vars, int vc) { |
| 4482 | int col_n = vc * CYP_EDGE_COLS; |
| 4483 | const char *col_names[CYP_COL_BUF]; |
| 4484 | for (int v = 0; v < vc; v++) { |
| 4485 | char buf[CBM_SZ_128]; |
| 4486 | snprintf(buf, sizeof(buf), "%s.name", vars[v]); |
| 4487 | col_names[(size_t)v * CYP_EDGE_COLS] = heap_strdup(buf); |
| 4488 | snprintf(buf, sizeof(buf), "%s.qualified_name", vars[v]); |
| 4489 | col_names[((size_t)v * CYP_EDGE_COLS) + SKIP_ONE] = heap_strdup(buf); |
| 4490 | snprintf(buf, sizeof(buf), "%s.label", vars[v]); |
| 4491 | col_names[((size_t)v * CYP_EDGE_COLS) + PAIR_LEN] = heap_strdup(buf); |
| 4492 | } |
| 4493 | rb_set_columns(rb, col_names, col_n); |
| 4494 | for (int i = 0; i < col_n; i++) { |
| 4495 | safe_str_free(&col_names[i]); |
| 4496 | } |
| 4497 | } |
| 4498 | |
| 4499 | /* Default projection when no RETURN clause */ |
| 4500 | static void execute_default_projection(cbm_pattern_t *pat0, binding_t *bindings, int bind_count, |
no test coverage detected