Lines Matching defs:sql
85 apr_dbd_t *sql,
178 static int dbd_sqlite3_select(apr_pool_t *pool, apr_dbd_t *sql,
186 if (sql->trans && sql->trans->errnum) {
187 return sql->trans->errnum;
192 ret = sqlite3_prepare(sql->conn, query, strlen(query), &stmt, &tail);
194 ret = dbd_sqlite3_select_internal(pool, sql, results, stmt, seek);
200 if (TXN_NOTICE_ERRORS(sql->trans)) {
201 sql->trans->errnum = ret;
333 static const char *dbd_sqlite3_error(apr_dbd_t *sql, int n)
335 return sqlite3_errmsg(sql->conn);
338 static int dbd_sqlite3_query_internal(apr_dbd_t *sql, sqlite3_stmt *stmt,
353 *nrows = sqlite3_changes(sql->conn);
361 static int dbd_sqlite3_query(apr_dbd_t *sql, int *nrows, const char *query)
367 if (sql->trans && sql->trans->errnum) {
368 return sql->trans->errnum;
375 ret = sqlite3_prepare(sql->conn, query, length, &stmt, &tail);
381 ret = dbd_sqlite3_query_internal(sql, stmt, nrows);
390 if (TXN_NOTICE_ERRORS(sql->trans)) {
391 sql->trans->errnum = ret;
403 apr_dbd_t *sql)
411 static int dbd_sqlite3_prepare(apr_pool_t *pool, apr_dbd_t *sql,
422 ret = sqlite3_prepare(sql->conn, query, strlen(query), &stmt, &tail);
426 prep = apr_pcalloc(sql->pool, sizeof(*prep));
428 prep->next = sql->prep;
434 sql->prep = prep;
480 static int dbd_sqlite3_pquery(apr_pool_t *pool, apr_dbd_t *sql,
487 if (sql->trans && sql->trans->errnum) {
488 return sql->trans->errnum;
497 ret = dbd_sqlite3_query_internal(sql, stmt, nrows);
504 if (TXN_NOTICE_ERRORS(sql->trans)) {
505 sql->trans->errnum = ret;
510 static int dbd_sqlite3_pvquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows,
516 if (sql->trans && sql->trans->errnum) {
517 return sql->trans->errnum;
526 return dbd_sqlite3_pquery(pool, sql, nrows, statement, values);
529 static int dbd_sqlite3_pselect(apr_pool_t *pool, apr_dbd_t *sql,
537 if (sql->trans && sql->trans->errnum) {
538 return sql->trans->errnum;
547 ret = dbd_sqlite3_select_internal(pool, sql, results, stmt, seek);
554 if (TXN_NOTICE_ERRORS(sql->trans)) {
555 sql->trans->errnum = ret;
560 static int dbd_sqlite3_pvselect(apr_pool_t *pool, apr_dbd_t *sql,
568 if (sql->trans && sql->trans->errnum) {
569 return sql->trans->errnum;
578 return dbd_sqlite3_pselect(pool, sql, results, statement, seek, values);
660 static int dbd_sqlite3_pbquery(apr_pool_t * pool, apr_dbd_t * sql,
667 if (sql->trans && sql->trans->errnum) {
668 return sql->trans->errnum;
677 ret = dbd_sqlite3_query_internal(sql, stmt, nrows);
684 if (TXN_NOTICE_ERRORS(sql->trans)) {
685 sql->trans->errnum = ret;
690 static int dbd_sqlite3_pvbquery(apr_pool_t * pool, apr_dbd_t * sql,
697 if (sql->trans && sql->trans->errnum) {
698 return sql->trans->errnum;
707 return dbd_sqlite3_pbquery(pool, sql, nrows, statement, values);
710 static int dbd_sqlite3_pbselect(apr_pool_t * pool, apr_dbd_t * sql,
718 if (sql->trans && sql->trans->errnum) {
719 return sql->trans->errnum;
728 ret = dbd_sqlite3_select_internal(pool, sql, results, stmt, seek);
735 if (TXN_NOTICE_ERRORS(sql->trans)) {
736 sql->trans->errnum = ret;
741 static int dbd_sqlite3_pvbselect(apr_pool_t * pool, apr_dbd_t * sql,
749 if (sql->trans && sql->trans->errnum) {
750 return sql->trans->errnum;
759 return dbd_sqlite3_pbselect(pool, sql, results, statement, seek, values);
818 apr_dbd_t *sql = NULL;
832 sql = apr_pcalloc(pool, sizeof(*sql));
833 sql->conn = conn;
834 sql->pool = pool;
835 sql->trans = NULL;
837 return sql;