MCPcopy Create free account
hub / github.com/apache/httpd / dbd_prepared_init

Function dbd_prepared_init

modules/database/mod_dbd.c:434–463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434static apr_status_t dbd_prepared_init(apr_pool_t *pool, dbd_cfg_t *cfg,
435 ap_dbd_t *rec)
436{
437 apr_hash_index_t *hi;
438
439 rec->prepared = apr_hash_make(pool);
440
441 for (hi = apr_hash_first(pool, cfg->queries); hi;
442 hi = apr_hash_next(hi)) {
443 const char *label, *query;
444 apr_dbd_prepared_t *stmt;
445
446 apr_hash_this(hi, (void*) &label, NULL, (void*) &query);
447
448 if (!strcmp(query, "")) {
449 continue;
450 }
451
452 stmt = NULL;
453 if (apr_dbd_prepare(rec->driver, pool, rec->handle, query,
454 label, &stmt)) {
455 return APR_EGENERAL;
456 }
457 else {
458 apr_hash_set(rec->prepared, label, APR_HASH_KEY_STRING, stmt);
459 }
460 }
461
462 return APR_SUCCESS;
463}
464
465static apr_status_t dbd_init_sql_init(apr_pool_t *pool, dbd_cfg_t *cfg,
466 ap_dbd_t *rec)

Callers 1

dbd_constructFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected