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

Function binding_out_append

src/cypher/cypher.c:3113–3126  ·  view source on GitHub ↗

Process edges: look up target node, filter by label/props, add binding. * `inbound` controls which end of the edge is the target id. */ #1196 (second mechanism): a hop's output buffer must hold EVERY matched * row. max_rows is an OUTPUT-row limit — projection already enforces it — and * WHERE/aggregation run after expansion, so any cap here silently falsifies * results: field-measured, count()

Source from the content-addressed store, hash-verified

3111 * only allocation failure stops materialisation (the #601 deadline still
3112 * bounds time), and match_count stays truthful either way (#627 contract). */
3113static bool binding_out_append(binding_t **rows, int *count, int *cap, binding_t *nb) {
3114 if (*count == *cap) {
3115 int next = *cap > 0 ? *cap * CYP_GROWTH_2 : CYP_GROWTH_10;
3116 binding_t *grown = realloc(*rows, (size_t)next * sizeof(binding_t));
3117 if (!grown) {
3118 binding_free(nb);
3119 return false;
3120 }
3121 *rows = grown;
3122 *cap = next;
3123 }
3124 (*rows)[(*count)++] = *nb;
3125 return true;
3126}
3127
3128static void process_edges(cbm_store_t *store, cbm_edge_t *edges, int edge_count, bool inbound,
3129 const cbm_node_pattern_t *target_node, binding_t *b, const char *to_var,

Callers 5

process_edgesFunction · 0.85
expand_var_lengthFunction · 0.85
expand_pattern_relsFunction · 0.85
cross_join_with_relsFunction · 0.85

Calls 1

binding_freeFunction · 0.85

Tested by

no test coverage detected