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

Function sqlv_push

internal/cbm/sql_values.c:310–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310static void sqlv_push(sqlv_ranges_t *r, TSRange range) {
311 if (r->failed) {
312 return;
313 }
314 if (r->count == r->cap) {
315 uint32_t cap = r->cap ? r->cap * SQLV_GROWTH : SQLV_INITIAL_CAP;
316 TSRange *grown =
317 (TSRange *)cbm_realloc(CBM_MEM_CLASS_EXTRACT, r->items, (size_t)cap * sizeof(TSRange));
318 if (!grown) {
319 r->failed = true;
320 return;
321 }
322 r->items = grown;
323 r->cap = cap;
324 }
325 r->items[r->count++] = range;
326}
327
328/* The cursor sits just past VALUES. Keep the first tuple; exclude each later
329 * literal-only tuple together with the comma before it. Runs of excluded tuples

Callers 1

sqlv_handle_valuesFunction · 0.85

Calls 1

cbm_reallocFunction · 0.85

Tested by

no test coverage detected