MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / execute_default_projection

Function execute_default_projection

src/cypher/cypher.c:4505–4526  ·  view source on GitHub ↗

Default projection when no RETURN clause */

Source from the content-addressed store, hash-verified

4503
4504/* Default projection when no RETURN clause */
4505static void execute_default_projection(cbm_pattern_t *pat0, binding_t *bindings, int bind_count,
4506 int max_rows, result_builder_t *rb) {
4507 const char *vars[CYP_MAX_VARS];
4508 int vc = 0;
4509 for (int ni = 0; ni < pat0->node_count && vc < CYP_MAX_VARS; ni++) {
4510 if (pat0->nodes[ni].variable) {
4511 vars[vc++] = pat0->nodes[ni].variable;
4512 }
4513 }
4514 build_default_columns(rb, vars, vc);
4515 for (int bi = 0; bi < bind_count && rb->row_count < max_rows; bi++) {
4516 const char *vals[CYP_COL_BUF];
4517 for (int v = 0; v < vc; v++) {
4518 cbm_node_t *n = binding_get(&bindings[bi], vars[v]);
4519 vals[(size_t)v * CYP_EDGE_COLS] = n && n->name ? n->name : "";
4520 vals[((size_t)v * CYP_EDGE_COLS) + SKIP_ONE] =
4521 n && n->qualified_name ? n->qualified_name : "";
4522 vals[((size_t)v * CYP_EDGE_COLS) + PAIR_LEN] = n && n->label ? n->label : "";
4523 }
4524 rb_add_row(rb, vals);
4525 }
4526}
4527
4528/* Worst-case binding_t slot count for a node cross-join: one row per
4529 * (existing binding × extra node), plus — for an OPTIONAL join with no extra

Callers 1

execute_singleFunction · 0.85

Calls 3

build_default_columnsFunction · 0.85
binding_getFunction · 0.85
rb_add_rowFunction · 0.85

Tested by

no test coverage detected