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

Function find_sql_hint_table

db/sql_stmt_cache.c:379–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379static int find_sql_hint_table(char *sql_hint, char **sql_str, void **dta,
380 int *dta_sz)
381{
382 sql_hint_hash_entry_type *entry;
383 Pthread_mutex_lock(&gbl_sql_lock);
384 entry = lrucache_find(sql_hints, &sql_hint);
385 Pthread_mutex_unlock(&gbl_sql_lock);
386
387 if (entry) {
388 *sql_str = entry->sql_str;
389 if (dta) {
390 *dta = entry->dta;
391 *dta_sz = entry->dta_sz;
392 }
393 return 0;
394 }
395 return -1;
396}
397
398static void add_sql_hint_table(char *sql_hint, char *sql_str, void *dta,
399 int dta_sz)

Callers 1

stmt_cache_getFunction · 0.85

Calls 1

lrucache_findFunction · 0.85

Tested by

no test coverage detected