Lines Matching refs:dbh
31 int _pdo_sqlite_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line) /* {{{ */ in _pdo_sqlite_error() argument
33 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in _pdo_sqlite_error()
34 pdo_error_type *pdo_err = stmt ? &stmt->error_code : &dbh->error_code; in _pdo_sqlite_error()
43 pefree(einfo->errmsg, dbh->is_persistent); in _pdo_sqlite_error()
45 einfo->errmsg = pestrdup((char*)sqlite3_errmsg(H->db), dbh->is_persistent); in _pdo_sqlite_error()
77 if (!dbh->methods) { in _pdo_sqlite_error()
85 static void pdo_sqlite_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info) in pdo_sqlite_fetch_error_func() argument
87 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_fetch_error_func()
149 static void sqlite_handle_closer(pdo_dbh_t *dbh) /* {{{ */ in sqlite_handle_closer() argument
151 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_closer()
166 pefree(einfo->errmsg, dbh->is_persistent); in sqlite_handle_closer()
169 pefree(H, dbh->is_persistent); in sqlite_handle_closer()
170 dbh->driver_data = NULL; in sqlite_handle_closer()
175 static bool sqlite_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver… in sqlite_handle_preparer() argument
177 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_preparer()
189 pdo_sqlite_error(dbh); in sqlite_handle_preparer()
198 pdo_sqlite_error(dbh); in sqlite_handle_preparer()
203 static zend_long sqlite_handle_doer(pdo_dbh_t *dbh, const zend_string *sql) in sqlite_handle_doer() argument
205 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_doer()
208 pdo_sqlite_error(dbh); in sqlite_handle_doer()
215 static zend_string *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const zend_string *name) in pdo_sqlite_last_insert_id() argument
217 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_last_insert_id()
223 static zend_string* sqlite_handle_quoter(pdo_dbh_t *dbh, const zend_string *unquoted, enum pdo_para… in sqlite_handle_quoter() argument
237 static bool sqlite_handle_begin(pdo_dbh_t *dbh) in sqlite_handle_begin() argument
239 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_begin()
242 pdo_sqlite_error(dbh); in sqlite_handle_begin()
248 static bool sqlite_handle_commit(pdo_dbh_t *dbh) in sqlite_handle_commit() argument
250 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_commit()
253 pdo_sqlite_error(dbh); in sqlite_handle_commit()
259 static bool sqlite_handle_rollback(pdo_dbh_t *dbh) in sqlite_handle_rollback() argument
261 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_rollback()
264 pdo_sqlite_error(dbh); in sqlite_handle_rollback()
270 static int pdo_sqlite_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value) in pdo_sqlite_get_attribute() argument
285 static bool pdo_sqlite_in_transaction(pdo_dbh_t *dbh) in pdo_sqlite_in_transaction() argument
287 pdo_sqlite_db_handle* H = (pdo_sqlite_db_handle*) dbh->driver_data; in pdo_sqlite_in_transaction()
294 static bool pdo_sqlite_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val) in pdo_sqlite_set_attr() argument
296 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_set_attr()
503 pdo_dbh_t *dbh; in pdo_sqlite_create_function_internal() local
515 dbh = Z_PDO_DBH_P(ZEND_THIS); in pdo_sqlite_create_function_internal()
518 H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_create_function_internal()
561 pdo_dbh_t *dbh; in pdo_sqlite_create_aggregate_internal() local
573 dbh = Z_PDO_DBH_P(ZEND_THIS); in pdo_sqlite_create_aggregate_internal()
576 H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_create_aggregate_internal()
636 pdo_dbh_t *dbh; in pdo_sqlite_create_collation_internal() local
645 dbh = Z_PDO_DBH_P(ZEND_THIS); in pdo_sqlite_create_collation_internal()
648 H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_create_collation_internal()
682 static const zend_function_entry *get_driver_methods(pdo_dbh_t *dbh, int kind) in get_driver_methods() argument
693 static void pdo_sqlite_request_shutdown(pdo_dbh_t *dbh) in pdo_sqlite_request_shutdown() argument
695 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_request_shutdown()
703 static void pdo_sqlite_get_gc(pdo_dbh_t *dbh, zend_get_gc_buffer *gc_buffer) in pdo_sqlite_get_gc() argument
705 pdo_sqlite_db_handle *H = dbh->driver_data; in pdo_sqlite_get_gc()
797 static int pdo_sqlite_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */ in pdo_sqlite_handle_factory() argument
804 H = pecalloc(1, sizeof(pdo_sqlite_db_handle), dbh->is_persistent); in pdo_sqlite_handle_factory()
808 dbh->driver_data = H; in pdo_sqlite_handle_factory()
811 dbh->skip_param_evt = 0x7F ^ (1 << PDO_PARAM_EVT_EXEC_PRE); in pdo_sqlite_handle_factory()
813 filename = make_filename_safe(dbh->data_source); in pdo_sqlite_handle_factory()
818 dbh->data_source); in pdo_sqlite_handle_factory()
832 pdo_sqlite_error(dbh); in pdo_sqlite_handle_factory()
845 dbh->alloc_own_columns = 1; in pdo_sqlite_handle_factory()
846 dbh->max_escaped_char_length = 2; in pdo_sqlite_handle_factory()
851 dbh->methods = &sqlite_methods; in pdo_sqlite_handle_factory()