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

Function stmt_cache_find_and_remove_entry

db/sql_stmt_cache.c:235–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235int stmt_cache_find_and_remove_entry(stmt_cache_t *stmt_cache, const char *sql, stmt_cache_entry_t **entry)
236{
237 if (stmt_cache->hash == NULL)
238 return -1;
239
240 if (strlen(sql) >= MAX_HASH_SQL_LENGTH)
241 return -1;
242
243 *entry = hash_find(stmt_cache->hash, sql);
244
245 if (*entry == NULL)
246 return -1;
247
248 stmt_cache_remove_entry(stmt_cache, *entry, 0); // will add again when done
249
250 return 0;
251}
252
253int stmt_cache_reset(stmt_cache_t *stmt_cache)
254{

Callers 2

execute_verify_indexesFunction · 0.85
stmt_cache_getFunction · 0.85

Calls 2

hash_findFunction · 0.85
stmt_cache_remove_entryFunction · 0.85

Tested by

no test coverage detected