php_resource_factory_handle_dtor(&obj->intern->factory, obj->intern->conn TSRMLS_CC);
php_resource_factory_dtor(&obj->intern->factory);
zend_hash_destroy(&obj->intern->listeners);
+ zend_hash_destroy(&obj->intern->statements);
zend_hash_destroy(&obj->intern->converters);
zend_hash_destroy(&obj->intern->eventhandlers);
efree(obj->intern);
static void php_pqconn_wakeup(php_persistent_handle_factory_t *f, void **handle TSRMLS_DC)
{
PGresult *res = PQexec(*handle, "");
- php_pq_clear_res(res);
+ php_pqres_clear(res);
if (CONNECTION_OK != PQstatus(*handle)) {
PQreset(*handle);
PGresult *res = unlisten(obj->intern->conn, key->arKey, key->nKeyLength - 1 TSRMLS_CC);
if (res) {
- php_pq_clear_res(res);
+ php_pqres_clear(res);
}
return ZEND_HASH_APPLY_REMOVE;
}
/* clean up async results */
while ((res = PQgetResult(*handle))) {
- php_pq_clear_res(res);
+ php_pqres_clear(res);
}
/* clean up transaction & session */
}
if (res) {
- php_pq_clear_res(res);
+ php_pqres_clear(res);
}
if (evdata) {
obj->intern->default_auto_convert = PHP_PQRES_CONV_ALL;
zend_hash_init(&obj->intern->listeners, 0, NULL, (dtor_func_t) zend_hash_destroy, 0);
+ zend_hash_init(&obj->intern->statements, 0, NULL, NULL, 0);
zend_hash_init(&obj->intern->converters, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_init(&obj->intern->eventhandlers, 0, NULL, (dtor_func_t) zend_hash_destroy, 0);
if (res) {
php_pqres_success(res TSRMLS_CC);
- php_pq_clear_res(res);
+ php_pqres_clear(res);
}
}
}
obj->intern->poller = PQconsumeInput;
php_pqconn_add_listener(obj, channel_str, channel_len, &listener TSRMLS_CC);
}
- php_pq_clear_res(res);
+ php_pqres_clear(res);
}
php_pqconn_notify_listeners(obj TSRMLS_CC);
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to notify listeners (%s)", PHP_PQerrorMessage(obj->intern->conn));
} else {
php_pqres_success(res TSRMLS_CC);
- php_pq_clear_res(res);
+ php_pqres_clear(res);
}
php_pqconn_notify_listeners(obj TSRMLS_CC);
} else if (SUCCESS == php_pqres_success(res TSRMLS_CC)) {
php_pq_object_to_zval_no_addref(PQresultInstanceData(res, php_pqconn_event), &return_value TSRMLS_CC);
} else {
- php_pq_clear_res(res);
+ php_pqres_clear(res);
}
php_pqconn_notify_listeners(obj TSRMLS_CC);
if (SUCCESS == php_pqres_success(res TSRMLS_CC)) {
php_pq_object_to_zval_no_addref(PQresultInstanceData(res, php_pqconn_event), &return_value TSRMLS_CC);
} else {
- php_pq_clear_res(res);
+ php_pqres_clear(res);
}
php_pqconn_notify_listeners(obj TSRMLS_CC);
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to prepare statement (%s)", PHP_PQerrorMessage(obj->intern->conn));
} else {
rv = php_pqres_success(res TSRMLS_CC);
- php_pq_clear_res(res);
+ php_pqres_clear(res);
php_pqconn_notify_listeners(obj TSRMLS_CC);
}
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to declare cursor (%s)", PHP_PQerrorMessage(obj->intern->conn));
} else {
rv = php_pqres_success(res TSRMLS_CC);
- php_pq_clear_res(res);
+ php_pqres_clear(res);
php_pqconn_notify_listeners(obj TSRMLS_CC);
}
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to start transaction (%s)", PHP_PQerrorMessage(conn_obj->intern->conn));
} else {
rv = php_pqres_success(res TSRMLS_CC);
- php_pq_clear_res(res);
+ php_pqres_clear(res);
php_pqconn_notify_listeners(conn_obj TSRMLS_CC);
}