MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / stmt_cache_remove_entry

Function stmt_cache_remove_entry

db/sql_stmt_cache.c:170–185  ·  view source on GitHub ↗

Remove from queue and stmt_cache->hash this entry so that subsequent finds of * the same sql will not find it but rather create a new stmt (to avoid having * stmt vdbe used by two sql at the same time). */

Source from the content-addressed store, hash-verified

168 * the same sql will not find it but rather create a new stmt (to avoid having
169 * stmt vdbe used by two sql at the same time). */
170static int stmt_cache_remove_entry(stmt_cache_t *stmt_cache,
171 stmt_cache_entry_t *entry, int noComplain)
172{
173 assert(entry);
174
175 void *list = GET_STMT_LIST(stmt_cache, entry->stmt);
176
177 listc_maybe_rfl(list, entry);
178 int rc = hash_del(stmt_cache->hash, entry->sql);
179 if (!noComplain && rc) {
180 logmsg(LOGMSG_ERROR, "%s:%d failed to delete entry (rc: %d)\n",
181 __func__, __LINE__, rc);
182 return rc;
183 }
184 return 0;
185}
186
187/* This will call stmt_cache_requeue_old_entry() after it has allocated memory for
188 * the new entry. On error will return non zero and caller will need to

Callers 3

stmt_cache_getFunction · 0.85
stmt_cache_put_intFunction · 0.85

Calls 3

listc_maybe_rflFunction · 0.85
hash_delFunction · 0.85
logmsgFunction · 0.50

Tested by

no test coverage detected