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_in_transaction() local
291 return H->db && sqlite3_get_autocommit(H->db) == 0; in pdo_sqlite_in_transaction()
296 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_set_attr() local
304 sqlite3_busy_timeout(H->db, lval * 1000); in pdo_sqlite_set_attr()
310 sqlite3_extended_result_codes(H->db, lval); in pdo_sqlite_set_attr()
503 pdo_sqlite_db_handle *H; in pdo_sqlite_create_function_internal() local
517 H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_create_function_internal()
521 …ret = sqlite3_create_function(H->db, ZSTR_VAL(func_name), argc, flags | SQLITE_UTF8, func, php_sql… in pdo_sqlite_create_function_internal()
529 func->next = H->funcs; in pdo_sqlite_create_function_internal()
530 H->funcs = func; in pdo_sqlite_create_function_internal()
560 pdo_sqlite_db_handle *H; in pdo_sqlite_create_aggregate_internal() local
574 H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_create_aggregate_internal()
578 ret = sqlite3_create_function(H->db, ZSTR_VAL(func_name), argc, SQLITE_UTF8, func, NULL, in pdo_sqlite_create_aggregate_internal()
588 func->next = H->funcs; in pdo_sqlite_create_aggregate_internal()
589 H->funcs = func; in pdo_sqlite_create_aggregate_internal()
634 pdo_sqlite_db_handle *H; in pdo_sqlite_create_collation_internal() local
645 H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_create_collation_internal()
649 ret = sqlite3_create_collation(H->db, ZSTR_VAL(collation_name), SQLITE_UTF8, collation, callback); in pdo_sqlite_create_collation_internal()
655 collation->next = H->collations; in pdo_sqlite_create_collation_internal()
656 H->collations = collation; in pdo_sqlite_create_collation_internal()
692 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_request_shutdown() local
695 if (H) { in pdo_sqlite_request_shutdown()
696 pdo_sqlite_cleanup_callbacks(H); in pdo_sqlite_request_shutdown()
702 pdo_sqlite_db_handle *H = dbh->driver_data; in pdo_sqlite_get_gc() local
704 struct pdo_sqlite_func *func = H->funcs; in pdo_sqlite_get_gc()
718 struct pdo_sqlite_collation *collation = H->collations; in pdo_sqlite_get_gc()
796 pdo_sqlite_db_handle *H; in pdo_sqlite_handle_factory() local
801 H = pecalloc(1, sizeof(pdo_sqlite_db_handle), dbh->is_persistent); in pdo_sqlite_handle_factory()
803 H->einfo.errcode = 0; in pdo_sqlite_handle_factory()
804 H->einfo.errmsg = NULL; in pdo_sqlite_handle_factory()
805 dbh->driver_data = H; in pdo_sqlite_handle_factory()
824 i = sqlite3_open_v2(filename, &H->db, flags, NULL); in pdo_sqlite_handle_factory()
834 sqlite3_set_authorizer(H->db, authorizer, NULL); in pdo_sqlite_handle_factory()
840 sqlite3_busy_timeout(H->db, timeout * 1000); in pdo_sqlite_handle_factory()