Lines Matching refs:pool
68 apr_pool_t *pool;
77 apr_pool_t *pool;
128 static int dbd_freetds_select(apr_pool_t *pool, apr_dbd_t *sql,
163 *results = apr_pcalloc(pool, sizeof(apr_dbd_results_t));
168 res->pool = pool;
171 apr_pool_cleanup_register(pool, sql->proc, clear_result,
176 res->vars = apr_palloc(pool, res->sz * sizeof(freetds_cell_t*));
181 cell->data = apr_palloc(pool, cell->len);
193 static const char *dbd_untaint(apr_pool_t *pool, regex_t *rx, const char *val)
201 return apr_pstrndup(pool, val+match[0].rm_so,
206 static const char *dbd_statement(apr_pool_t *pool,
225 p_out = ret = apr_palloc(pool, len);
232 var = dbd_untaint(pool, stmt->taint[i], args[i]);
242 static int dbd_freetds_pselect(apr_pool_t *pool, apr_dbd_t *sql,
247 const char *query = dbd_statement(pool, statement,
249 return dbd_freetds_select(pool, sql, results, query, seek);
251 static int dbd_freetds_pvselect(apr_pool_t *pool, apr_dbd_t *sql,
263 values = apr_palloc(pool, sizeof(*values) * statement->nargs);
269 return dbd_freetds_pselect(pool, sql, results, statement, seek, values);
272 static int dbd_freetds_pquery(apr_pool_t *pool, apr_dbd_t *sql,
276 const char *query = dbd_statement(pool, statement,
280 static int dbd_freetds_pvquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows,
290 values = apr_palloc(pool, sizeof(*values) * statement->nargs);
295 return dbd_freetds_pquery(pool, sql, nrows, statement, values);
298 static int dbd_freetds_get_row(apr_pool_t *pool, apr_dbd_results_t *res,
306 row = apr_palloc(pool, sizeof(apr_dbd_row_t));
330 apr_pool_cleanup_run(res->pool, res->proc, clear_result);
361 return apr_psprintf(sql->pool, "Error %d", sql->err);
381 static const char *dbd_freetds_escape(apr_pool_t *pool, const char *arg,
392 static int recurse_args(apr_pool_t *pool, int n, const char *query,
403 stmt->taint = apr_palloc(pool, n*sizeof(regex_t*));
404 stmt->sz = apr_palloc(pool, n*sizeof(int));
415 ret = recurse_args(pool, n+1, query+matches[0].rm_eo,
430 stmt->taint[n] = apr_palloc(pool, sizeof(regex_t));
435 apr_pool_cleanup_register(pool, stmt->taint[n], freetds_regfree,
448 static int dbd_freetds_prepare(apr_pool_t *pool, apr_dbd_t *sql,
456 label = apr_psprintf(pool, "%d", labelnum++);
460 *statement = apr_palloc(pool, sizeof(apr_dbd_prepared_t));
466 stmt->fmt = apr_pstrdup(pool, query);
467 stmt->fmt = recurse_args(pool, 0, query, stmt, stmt->fmt);
477 pquery = apr_pcalloc(pool, len);
491 stmt->fmt = apr_pstrdup(pool, query);
492 return recurse_args(pool, 0, query, stmt, 0);
497 static int dbd_freetds_start_transaction(apr_pool_t *pool, apr_dbd_t *handle,
508 *trans = apr_pcalloc(pool, sizeof(apr_dbd_transaction_t));
537 static DBPROCESS *freetds_open(apr_pool_t *pool, const char *params,
575 buf = apr_pstrndup(pool, value, vlen); /* NULL-terminated copy */
621 static apr_dbd_t *dbd_freetds_open(apr_pool_t *pool, const char *params,
626 DBPROCESS *process = freetds_open(pool, params, error);
630 sql = apr_pcalloc(pool, sizeof (apr_dbd_t));
631 sql->pool = pool;
643 static apr_status_t dbd_freetds_check_conn(apr_pool_t *pool,
649 handle->proc = freetds_open(handle->pool, handle->params, NULL);
659 static int dbd_freetds_select_db(apr_pool_t *pool, apr_dbd_t *handle,
697 static void dbd_freetds_init(apr_pool_t *pool)
708 apr_pool_cleanup_register(pool, NULL, freetds_term, apr_pool_cleanup_null);
734 static int dbd_freetds_pvbquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows,
739 static int dbd_freetds_pbquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows,
746 static int dbd_freetds_pvbselect(apr_pool_t *pool, apr_dbd_t *sql,
753 static int dbd_freetds_pbselect(apr_pool_t *pool, apr_dbd_t *sql,