Commit b8d440d2 authored by Nick Kew's avatar Nick Kew
Browse files

Try to get a meaningful error message when dbd_open fails


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@689224 13f79535-47bb-0310-9956-ffa450edef68
parent 8a20c586
Loading
Loading
Loading
Loading
+3 −2
Changes for modules/database/mod_dbd.c: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -464,6 +464,7 @@ static apr_status_t dbd_construct(void **data_ptr,
    apr_pool_t *rec_pool, *prepared_pool;
    ap_dbd_t *rec;
    apr_status_t rv;
    const char *err = "";

    rv = apr_pool_create(&rec_pool, pool);
    if (rv != APR_SUCCESS) {
@@ -507,12 +508,12 @@ static apr_status_t dbd_construct(void **data_ptr,
        return rv;
    }

    rv = apr_dbd_open(rec->driver, rec->pool, cfg->params, &rec->handle);
    rv = apr_dbd_open_ex(rec->driver, rec->pool, cfg->params, &rec->handle, &err);
    if (rv != APR_SUCCESS) {
        switch (rv) {
        case APR_EGENERAL:
            ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server,
                         "DBD: Can't connect to %s", cfg->name);
                         "DBD: Can't connect to %s: %s", cfg->name, &err);
            break;
        default:
            ap_log_error(APLOG_MARK, APLOG_ERR, rv, cfg->server,