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

Function ap_dbd_prepare

modules/database/mod_dbd.c:313–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311}
312
313DBD_DECLARE_NONSTD(void) ap_dbd_prepare(server_rec *s, const char *query,
314 const char *label)
315{
316 svr_cfg *svr;
317
318 svr = ap_get_module_config(s->module_config, &dbd_module);
319 if (!svr) {
320 /* some modules may call from within config directive handlers, and
321 * if these are called in a server context that contains no mod_dbd
322 * config directives, then we have to create our own server config
323 */
324 svr = create_dbd_config(config_pool, s);
325 ap_set_module_config(s->module_config, &dbd_module, svr);
326 }
327
328 if (apr_hash_get(svr->cfg->queries, label, APR_HASH_KEY_STRING)
329 && strcmp(query, "")) {
330 ap_log_error(APLOG_MARK, APLOG_WARNING, 0, s, APLOGNO(02653)
331 "conflicting SQL statements with label %s", label);
332 }
333
334 apr_hash_set(svr->cfg->queries, label, APR_HASH_KEY_STRING, query);
335}
336
337typedef struct {
338 const char *label, *query;

Callers 1

dbd_prepareFunction · 0.85

Calls 4

ap_get_module_configFunction · 0.85
create_dbd_configFunction · 0.85
ap_set_module_configFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected