Lines Matching refs:H
36 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in _pdo_sqlite_error() local
38 pdo_sqlite_error_info *einfo = &H->einfo; in _pdo_sqlite_error()
40 einfo->errcode = sqlite3_errcode(H->db); in _pdo_sqlite_error()
48 einfo->errmsg = pestrdup((char*)sqlite3_errmsg(H->db), dbh->is_persistent); in _pdo_sqlite_error()
91 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_fetch_error_func() local
92 pdo_sqlite_error_info *einfo = &H->einfo; in pdo_sqlite_fetch_error_func()
102 static void pdo_sqlite_cleanup_callbacks(pdo_sqlite_db_handle *H TSRMLS_DC) in pdo_sqlite_cleanup_callbacks()
106 while (H->funcs) { in pdo_sqlite_cleanup_callbacks()
107 func = H->funcs; in pdo_sqlite_cleanup_callbacks()
108 H->funcs = func->next; in pdo_sqlite_cleanup_callbacks()
110 if (H->db) { in pdo_sqlite_cleanup_callbacks()
112 sqlite3_create_function(H->db, in pdo_sqlite_cleanup_callbacks()
133 while (H->collations) { in pdo_sqlite_cleanup_callbacks()
135 collation = H->collations; in pdo_sqlite_cleanup_callbacks()
136 H->collations = collation->next; in pdo_sqlite_cleanup_callbacks()
138 if (H->db) { in pdo_sqlite_cleanup_callbacks()
140 sqlite3_create_collation(H->db, in pdo_sqlite_cleanup_callbacks()
157 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_closer() local
159 if (H) { in sqlite_handle_closer()
160 pdo_sqlite_error_info *einfo = &H->einfo; in sqlite_handle_closer()
162 pdo_sqlite_cleanup_callbacks(H TSRMLS_CC); in sqlite_handle_closer()
163 if (H->db) { in sqlite_handle_closer()
164 sqlite3_close(H->db); in sqlite_handle_closer()
165 H->db = NULL; in sqlite_handle_closer()
171 pefree(H, dbh->is_persistent); in sqlite_handle_closer()
180 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_preparer() local
185 S->H = H; in sqlite_handle_preparer()
191 H->einfo.errcode = SQLITE_ERROR; in sqlite_handle_preparer()
196 i = sqlite3_prepare(H->db, sql, sql_len, &S->stmt, &tail); in sqlite_handle_preparer()
208 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_doer() local
211 if (sqlite3_exec(H->db, sql, NULL, NULL, &errmsg) != SQLITE_OK) { in sqlite_handle_doer()
218 return sqlite3_changes(H->db); in sqlite_handle_doer()
224 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_last_insert_id() local
227 id = php_pdo_int64_to_str(sqlite3_last_insert_rowid(H->db) TSRMLS_CC); in pdo_sqlite_last_insert_id()
243 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_begin() local
246 if (sqlite3_exec(H->db, "BEGIN", NULL, NULL, &errmsg) != SQLITE_OK) { in sqlite_handle_begin()
257 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_commit() local
260 if (sqlite3_exec(H->db, "COMMIT", NULL, NULL, &errmsg) != SQLITE_OK) { in sqlite_handle_commit()
271 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in sqlite_handle_rollback() local
274 if (sqlite3_exec(H->db, "ROLLBACK", NULL, NULL, &errmsg) != SQLITE_OK) { in sqlite_handle_rollback()
300 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_set_attr() local
305 sqlite3_busy_timeout(H->db, Z_LVAL_P(val) * 1000); in pdo_sqlite_set_attr()
543 pdo_sqlite_db_handle *H; in PHP_METHOD() local
561 H = (pdo_sqlite_db_handle *)dbh->driver_data; in PHP_METHOD()
565 ret = sqlite3_create_function(H->db, func_name, argc, SQLITE_UTF8, in PHP_METHOD()
575 func->next = H->funcs; in PHP_METHOD()
576 H->funcs = func; in PHP_METHOD()
614 pdo_sqlite_db_handle *H; in PHP_METHOD() local
638 H = (pdo_sqlite_db_handle *)dbh->driver_data; in PHP_METHOD()
642 ret = sqlite3_create_function(H->db, func_name, argc, SQLITE_UTF8, in PHP_METHOD()
655 func->next = H->funcs; in PHP_METHOD()
656 H->funcs = func; in PHP_METHOD()
676 pdo_sqlite_db_handle *H; in PHP_METHOD() local
694 H = (pdo_sqlite_db_handle *)dbh->driver_data; in PHP_METHOD()
698 …ret = sqlite3_create_collation(H->db, collation_name, SQLITE_UTF8, collation, php_sqlite3_collatio… in PHP_METHOD()
705 collation->next = H->collations; in PHP_METHOD()
706 H->collations = collation; in PHP_METHOD()
736 pdo_sqlite_db_handle *H = (pdo_sqlite_db_handle *)dbh->driver_data; in pdo_sqlite_request_shutdown() local
739 if (H) { in pdo_sqlite_request_shutdown()
740 pdo_sqlite_cleanup_callbacks(H TSRMLS_CC); in pdo_sqlite_request_shutdown()
812 pdo_sqlite_db_handle *H; in pdo_sqlite_handle_factory() local
817 H = pecalloc(1, sizeof(pdo_sqlite_db_handle), dbh->is_persistent); in pdo_sqlite_handle_factory()
819 H->einfo.errcode = 0; in pdo_sqlite_handle_factory()
820 H->einfo.errmsg = NULL; in pdo_sqlite_handle_factory()
821 dbh->driver_data = H; in pdo_sqlite_handle_factory()
832 i = sqlite3_open(filename, &H->db); in pdo_sqlite_handle_factory()
841 sqlite3_set_authorizer(H->db, authorizer, NULL); in pdo_sqlite_handle_factory()
847 sqlite3_busy_timeout(H->db, timeout * 1000); in pdo_sqlite_handle_factory()