MCPcopy Create free account
hub / github.com/ElementsProject/lightning / db_stmt_free

Function db_stmt_free

db/utils.c:42–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42static void db_stmt_free(struct db_stmt *stmt)
43{
44 if (!stmt->executed)
45 db_fatal(stmt->db, "Freeing an un-executed statement from %s: %s",
46 stmt->location, stmt->query->query);
47 /* If they never got a db_step, we don't track */
48 if (stmt->db->developer && stmt->cols_used) {
49 for (size_t i = 0; i < stmt->query->num_colnames; i++) {
50 if (!stmt->query->colnames[i].sqlname)
51 continue;
52 if (!strset_get(stmt->cols_used,
53 stmt->query->colnames[i].sqlname)) {
54 db_fatal(stmt->db, "Never accessed column %s in query %s",
55 stmt->query->colnames[i].sqlname,
56 stmt->query->query);
57 }
58 }
59 strset_clear(stmt->cols_used);
60 }
61
62 if (stmt->inner_stmt)
63 stmt->db->config->stmt_free_fn(stmt);
64 assert(stmt->inner_stmt == NULL);
65}
66
67
68static struct db_stmt *db_prepare_core(struct db *db,

Callers

nothing calls this directly

Calls 3

db_fatalFunction · 0.85
strset_getFunction · 0.85
strset_clearFunction · 0.85

Tested by

no test coverage detected