Lines Matching refs:H
33 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in _pdo_sqlite_error() local
35 pdo_sqlite_error_info *einfo = &H->einfo; in _pdo_sqlite_error()
37 einfo->errcode = sqlite3_errcode(H->db); in _pdo_sqlite_error()
45 einfo->errmsg = pestrdup((char*)sqlite3_errmsg(H->db), dbh->is_persistent); in _pdo_sqlite_error()
87 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_fetch_error_func() local
88 pdo_sqlite_error_info *einfo = &H->einfo; in pdo_sqlite_fetch_error_func()
96 static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H) in pdo_sqlite_cleanup_callbacks() argument
100 while (H->funcs) { in pdo_sqlite_cleanup_callbacks()
101 func = H->funcs; in pdo_sqlite_cleanup_callbacks()
102 H->funcs = func->next; in pdo_sqlite_cleanup_callbacks()
104 if (H->db) { in pdo_sqlite_cleanup_callbacks()
106 sqlite3_create_function(H->db, in pdo_sqlite_cleanup_callbacks()
127 while (H->collations) { in pdo_sqlite_cleanup_callbacks()
129 collation = H->collations; in pdo_sqlite_cleanup_callbacks()
130 H->collations = collation->next; in pdo_sqlite_cleanup_callbacks()
132 if (H->db) { in pdo_sqlite_cleanup_callbacks()
134 sqlite3_create_collation(H->db, in pdo_sqlite_cleanup_callbacks()
151 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_closer() local
153 if (H) { in sqlite_handle_closer()
154 pdo_sqlite_error_info *einfo = &H->einfo; in sqlite_handle_closer()
156 pdo_sqlite_cleanup_callbacks(H); in sqlite_handle_closer()
157 if (H->db) { in sqlite_handle_closer()
159 sqlite3_close_v2(H->db); in sqlite_handle_closer()
161 sqlite3_close(H->db); in sqlite_handle_closer()
163 H->db = NULL; in sqlite_handle_closer()
169 pefree(H, dbh->is_persistent); in sqlite_handle_closer()
177 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_preparer() local
182 S->H = H; in sqlite_handle_preparer()
188 H->einfo.errcode = SQLITE_ERROR; in sqlite_handle_preparer()
193 i = sqlite3_prepare_v2(H->db, ZSTR_VAL(sql), ZSTR_LEN(sql), &S->stmt, &tail); in sqlite_handle_preparer()
205 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_doer() local
207 if (sqlite3_exec(H->db, ZSTR_VAL(sql), NULL, NULL, NULL) != SQLITE_OK) { in sqlite_handle_doer()
211 return sqlite3_changes(H->db); in sqlite_handle_doer()
217 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_last_insert_id() local
219 return zend_i64_to_str(sqlite3_last_insert_rowid(H->db)); in pdo_sqlite_last_insert_id()
239 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_begin() local
241 if (sqlite3_exec(H->db, "BEGIN", NULL, NULL, NULL) != SQLITE_OK) { in sqlite_handle_begin()
250 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_commit() local
252 if (sqlite3_exec(H->db, "COMMIT", NULL, NULL, NULL) != SQLITE_OK) { in sqlite_handle_commit()
261 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_rollback() local
263 if (sqlite3_exec(H->db, "ROLLBACK", NULL, NULL, NULL) != SQLITE_OK) { in sqlite_handle_rollback()
287 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_set_attr() local
295 sqlite3_busy_timeout(H->db, lval * 1000); in pdo_sqlite_set_attr()
301 sqlite3_extended_result_codes(H->db, lval); in pdo_sqlite_set_attr()
522 pdo_sqlite_db_handle *H; in PHP_METHOD() local
536 H = (pdo_sqlite_db_handle *)dbh->driver_data; in PHP_METHOD()
540 ret = sqlite3_create_function(H->db, func_name, argc, flags | SQLITE_UTF8, in PHP_METHOD()
549 func->next = H->funcs; in PHP_METHOD()
550 H->funcs = func; in PHP_METHOD()
588 pdo_sqlite_db_handle *H; in PHP_METHOD() local
602 H = (pdo_sqlite_db_handle *)dbh->driver_data; in PHP_METHOD()
606 ret = sqlite3_create_function(H->db, func_name, argc, SQLITE_UTF8, in PHP_METHOD()
617 func->next = H->funcs; in PHP_METHOD()
618 H->funcs = func; in PHP_METHOD()
638 pdo_sqlite_db_handle *H; in PHP_METHOD() local
649 H = (pdo_sqlite_db_handle *)dbh->driver_data; in PHP_METHOD()
653 …ret = sqlite3_create_collation(H->db, collation_name, SQLITE_UTF8, collation, php_sqlite3_collatio… in PHP_METHOD()
659 collation->next = H->collations; in PHP_METHOD()
660 H->collations = collation; in PHP_METHOD()
683 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_request_shutdown() local
686 if (H) { in pdo_sqlite_request_shutdown()
687 pdo_sqlite_cleanup_callbacks(H); in pdo_sqlite_request_shutdown()
693 pdo_sqlite_db_handle *H = dbh->driver_data; in pdo_sqlite_get_gc() local
695 struct pdo_sqlite_func *func = H->funcs; in pdo_sqlite_get_gc()
703 struct pdo_sqlite_collation *collation = H->collations; in pdo_sqlite_get_gc()
778 pdo_sqlite_db_handle *H; in pdo_sqlite_handle_factory() local
783 H = pecalloc(1, sizeof(pdo_sqlite_db_handle), dbh->is_persistent); in pdo_sqlite_handle_factory()
785 H->einfo.errcode = 0; in pdo_sqlite_handle_factory()
786 H->einfo.errmsg = NULL; in pdo_sqlite_handle_factory()
787 dbh->driver_data = H; in pdo_sqlite_handle_factory()
806 i = sqlite3_open_v2(filename, &H->db, flags, NULL); in pdo_sqlite_handle_factory()
816 sqlite3_set_authorizer(H->db, authorizer, NULL); in pdo_sqlite_handle_factory()
822 sqlite3_busy_timeout(H->db, timeout * 1000); in pdo_sqlite_handle_factory()