| 311 | } |
| 312 | |
| 313 | DBD_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 | |
| 337 | typedef struct { |
| 338 | const char *label, *query; |
no test coverage detected