| 233 | } |
| 234 | |
| 235 | int 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 | |
| 253 | int stmt_cache_reset(stmt_cache_t *stmt_cache) |
| 254 | { |
no test coverage detected