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

Function db_exec_prepared_v2

db/utils.c:167–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167bool db_exec_prepared_v2(struct db_stmt *stmt TAKES)
168{
169 bool ret = stmt->db->config->exec_fn(stmt);
170
171 /* If this was a write we need to bump the data_version upon commit. */
172 stmt->db->dirty = stmt->db->dirty || !stmt->query->readonly;
173
174 stmt->executed = true;
175 list_del_from(&stmt->db->pending_statements, &stmt->list);
176
177 /* The driver itself doesn't call `fatal` since we want to override it
178 * for testing. Instead we check here that the error message is set if
179 * we report an error. */
180 if (!ret) {
181 assert(stmt->error);
182 db_fatal("Error executing statement: %s", stmt->error);
183 }
184
185 if (taken(stmt))
186 tal_free(stmt);
187
188 return ret;
189}
190
191size_t db_count_changes(struct db_stmt *stmt)
192{

Calls 4

list_del_fromFunction · 0.85
takenFunction · 0.85
tal_freeFunction · 0.85
db_fatalFunction · 0.50

Tested by 3

test_primitivesFunction · 0.68
test_manip_columnsFunction · 0.68
test_htlc_crudFunction · 0.68