Lines Matching refs:H
69 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in _pdo_pgsql_error() local
71 pdo_pgsql_error_info *einfo = &H->einfo; in _pdo_pgsql_error()
72 char *errmsg = PQerrorMessage(H->server); in _pdo_pgsql_error()
113 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in pdo_pgsql_fetch_error_func() local
114 pdo_pgsql_error_info *einfo = &H->einfo; in pdo_pgsql_fetch_error_func()
144 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)(Z_PDO_DBH_P(&self->dbh))->driver_data; in pgsql_lob_close() local
149 zend_hash_index_del(H->lob_streams, php_stream_get_resource_id(stream)); in pgsql_lob_close()
189 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)(Z_PDO_DBH_P(dbh))->driver_data; in pdo_pgsql_create_lob_stream() local
194 self->conn = H->server; in pdo_pgsql_create_lob_stream()
200 zend_hash_index_add_ptr(H->lob_streams, php_stream_get_resource_id(stm), stm->res); in pdo_pgsql_create_lob_stream()
212 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in pdo_pgsql_close_lob_streams() local
213 if (H->lob_streams) { in pdo_pgsql_close_lob_streams()
214 ZEND_HASH_REVERSE_FOREACH_PTR(H->lob_streams, res) { in pdo_pgsql_close_lob_streams()
224 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in pgsql_handle_closer() local
225 if (H) { in pgsql_handle_closer()
226 if (H->lob_streams) { in pgsql_handle_closer()
228 zend_hash_destroy(H->lob_streams); in pgsql_handle_closer()
229 pefree(H->lob_streams, dbh->is_persistent); in pgsql_handle_closer()
230 H->lob_streams = NULL; in pgsql_handle_closer()
232 if (H->server) { in pgsql_handle_closer()
233 PQfinish(H->server); in pgsql_handle_closer()
234 H->server = NULL; in pgsql_handle_closer()
236 if (H->einfo.errmsg) { in pgsql_handle_closer()
237 pefree(H->einfo.errmsg, dbh->is_persistent); in pgsql_handle_closer()
238 H->einfo.errmsg = NULL; in pgsql_handle_closer()
240 pefree(H, dbh->is_persistent); in pgsql_handle_closer()
248 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in pgsql_handle_preparer() local
256 S->H = H; in pgsql_handle_preparer()
267 spprintf(&S->cursor_name, 0, "pdo_crsr_%08x", ++H->stmt_counter); in pgsql_handle_preparer()
270 if (pdo_attr_lval(driver_options, PDO_ATTR_EMULATE_PREPARES, H->emulate_prepares) == 1) { in pgsql_handle_preparer()
273 if (pdo_attr_lval(driver_options, PDO_PGSQL_ATTR_DISABLE_PREPARES, H->disable_prepares) == 1) { in pgsql_handle_preparer()
277 emulate = H->disable_native_prepares || H->emulate_prepares; in pgsql_handle_preparer()
278 execute_only = H->disable_prepares; in pgsql_handle_preparer()
281 if (!emulate && PQprotocolVersion(H->server) <= 2) { in pgsql_handle_preparer()
308 spprintf(&S->stmt_name, 0, "pdo_stmt_%08x", ++H->stmt_counter); in pgsql_handle_preparer()
316 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in pgsql_handle_doer() local
323 if (!(res = PQexec(H->server, ZSTR_VAL(sql)))) { in pgsql_handle_doer()
334 H->pgoid = PQoidValue(res); in pgsql_handle_doer()
354 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in pgsql_handle_quoter() local
360 …escaped = PQescapeByteaConn(H->server, (unsigned char *)ZSTR_VAL(unquoted), ZSTR_LEN(unquoted), &t… in pgsql_handle_quoter()
372 …quotedlen = PQescapeStringConn(H->server, quoted + 1, ZSTR_VAL(unquoted), ZSTR_LEN(unquoted), NULL… in pgsql_handle_quoter()
385 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in pdo_pgsql_last_insert_id() local
391 res = PQexec(H->server, "SELECT LASTVAL()"); in pdo_pgsql_last_insert_id()
396 res = PQexecParams(H->server, "SELECT CURRVAL($1)", 1, NULL, q, NULL, NULL, 0); in pdo_pgsql_last_insert_id()
429 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in pdo_pgsql_get_attribute() local
433 ZVAL_BOOL(return_value, H->emulate_prepares); in pdo_pgsql_get_attribute()
437 ZVAL_BOOL(return_value, H->disable_prepares); in pdo_pgsql_get_attribute()
448 if (PQprotocolVersion(H->server) >= 3) { /* PostgreSQL 7.4 or later */ in pdo_pgsql_get_attribute()
449 ZVAL_STRING(return_value, (char*)PQparameterStatus(H->server, "server_version")); in pdo_pgsql_get_attribute()
452 PGresult *res = PQexec(H->server, "SELECT VERSION()"); in pdo_pgsql_get_attribute()
464 switch (PQstatus(H->server)) { in pdo_pgsql_get_attribute()
518 int spid = PQbackendPID(H->server); in pdo_pgsql_get_attribute()
525 (char*)PQparameterStatus(H->server, "client_encoding"), in pdo_pgsql_get_attribute()
526 (char*)PQparameterStatus(H->server, "is_superuser"), in pdo_pgsql_get_attribute()
527 (char*)PQparameterStatus(H->server, "session_authorization"), in pdo_pgsql_get_attribute()
528 (char*)PQparameterStatus(H->server, "DateStyle")); in pdo_pgsql_get_attribute()
544 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in pdo_pgsql_check_liveness() local
545 if (!PQconsumeInput(H->server) || PQstatus(H->server) == CONNECTION_BAD) { in pdo_pgsql_check_liveness()
546 PQreset(H->server); in pdo_pgsql_check_liveness()
548 return (PQstatus(H->server) == CONNECTION_OK) ? SUCCESS : FAILURE; in pdo_pgsql_check_liveness()
554 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in pgsql_handle_in_transaction() local
556 return PQtransactionStatus(H->server) > PQTRANS_IDLE; in pgsql_handle_in_transaction()
561 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in pdo_pgsql_transaction_cmd() local
565 res = PQexec(H->server, cmd); in pdo_pgsql_transaction_cmd()
611 pdo_pgsql_db_handle *H; in PHP_METHOD() local
645 H = (pdo_pgsql_db_handle *)dbh->driver_data; in PHP_METHOD()
647 while ((pgsql_result = PQgetResult(H->server))) { in PHP_METHOD()
650 pgsql_result = PQexec(H->server, query); in PHP_METHOD()
658 status = (ExecStatusType) PQstatus(H->server); in PHP_METHOD()
684 if (PQputCopyData(H->server, query, query_len) != 1) { in PHP_METHOD()
695 if (PQputCopyEnd(H->server, NULL) != 1) { in PHP_METHOD()
701 while ((pgsql_result = PQgetResult(H->server))) { in PHP_METHOD()
724 pdo_pgsql_db_handle *H; in PHP_METHOD() local
758 H = (pdo_pgsql_db_handle *)dbh->driver_data; in PHP_METHOD()
760 while ((pgsql_result = PQgetResult(H->server))) { in PHP_METHOD()
763 pgsql_result = PQexec(H->server, query); in PHP_METHOD()
770 status = (ExecStatusType) PQstatus(H->server); in PHP_METHOD()
780 if (PQputCopyData(H->server, buf, line_len) != 1) { in PHP_METHOD()
791 if (PQputCopyEnd(H->server, NULL) != 1) { in PHP_METHOD()
797 while ((pgsql_result = PQgetResult(H->server))) { in PHP_METHOD()
822 pdo_pgsql_db_handle *H; in PHP_METHOD() local
843 H = (pdo_pgsql_db_handle *)dbh->driver_data; in PHP_METHOD()
852 while ((pgsql_result = PQgetResult(H->server))) { in PHP_METHOD()
862 pgsql_result = PQexec(H->server, query); in PHP_METHOD()
868 status = (ExecStatusType) PQstatus(H->server); in PHP_METHOD()
875 int ret = PQgetCopyData(H->server, &csv, 0); in PHP_METHOD()
898 while ((pgsql_result = PQgetResult(H->server))) { in PHP_METHOD()
916 pdo_pgsql_db_handle *H; in PHP_METHOD() local
935 H = (pdo_pgsql_db_handle *)dbh->driver_data; in PHP_METHOD()
937 while ((pgsql_result = PQgetResult(H->server))) { in PHP_METHOD()
947 pgsql_result = PQexec(H->server, query); in PHP_METHOD()
953 status = (ExecStatusType) PQstatus(H->server); in PHP_METHOD()
962 int ret = PQgetCopyData(H->server, &csv, 0); in PHP_METHOD()
975 while ((pgsql_result = PQgetResult(H->server))) { in PHP_METHOD()
992 pdo_pgsql_db_handle *H; in PHP_METHOD() local
1001 H = (pdo_pgsql_db_handle *)dbh->driver_data; in PHP_METHOD()
1002 lfd = lo_creat(H->server, INV_READ|INV_WRITE); in PHP_METHOD()
1020 pdo_pgsql_db_handle *H; in PHP_METHOD() local
1048 H = (pdo_pgsql_db_handle *)dbh->driver_data; in PHP_METHOD()
1050 lfd = lo_open(H->server, oid, mode); in PHP_METHOD()
1071 pdo_pgsql_db_handle *H; in PHP_METHOD() local
1090 H = (pdo_pgsql_db_handle *)dbh->driver_data; in PHP_METHOD()
1092 if (1 == lo_unlink(H->server, oid)) { in PHP_METHOD()
1106 pdo_pgsql_db_handle *H; in PHP_METHOD() local
1138 H = (pdo_pgsql_db_handle *)dbh->driver_data; in PHP_METHOD()
1140 if (!PQconsumeInput(H->server)) { in PHP_METHOD()
1145 pgsql_notify = PQnotifies(H->server); in PHP_METHOD()
1148 php_pollfd_for_ms(PQsocket(H->server), PHP_POLLREADABLE, (int)ms_timeout); in PHP_METHOD()
1150 if (!PQconsumeInput(H->server)) { in PHP_METHOD()
1155 pgsql_notify = PQnotifies(H->server); in PHP_METHOD()
1186 pdo_pgsql_db_handle *H; in PHP_METHOD() local
1193 H = (pdo_pgsql_db_handle *)dbh->driver_data; in PHP_METHOD()
1195 RETURN_LONG(PQbackendPID(H->server)); in PHP_METHOD()
1212 pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; in pdo_pgsql_set_attr() local
1219 H->emulate_prepares = bval; in pdo_pgsql_set_attr()
1225 H->disable_prepares = bval; in pdo_pgsql_set_attr()
1253 pdo_pgsql_db_handle *H; in pdo_pgsql_handle_factory() local
1259 H = pecalloc(1, sizeof(pdo_pgsql_db_handle), dbh->is_persistent); in pdo_pgsql_handle_factory()
1260 dbh->driver_data = H; in pdo_pgsql_handle_factory()
1267 H->einfo.errcode = 0; in pdo_pgsql_handle_factory()
1268 H->einfo.errmsg = NULL; in pdo_pgsql_handle_factory()
1298 H->server = PQconnectdb(conn_str); in pdo_pgsql_handle_factory()
1299 H->lob_streams = (HashTable *) pemalloc(sizeof(HashTable), dbh->is_persistent); in pdo_pgsql_handle_factory()
1300 zend_hash_init(H->lob_streams, 0, NULL, NULL, 1); in pdo_pgsql_handle_factory()
1311 if (PQstatus(H->server) != CONNECTION_OK) { in pdo_pgsql_handle_factory()
1316 PQsetNoticeProcessor(H->server, (void(*)(void*,const char*))_pdo_pgsql_notice, (void *)&dbh); in pdo_pgsql_handle_factory()
1318 H->attached = 1; in pdo_pgsql_handle_factory()
1319 H->pgoid = -1; in pdo_pgsql_handle_factory()