throw_exce(EX_IO, "Failed to close cursor (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
}
} else {
- if ((res = PQexec(obj->intern->conn->intern->conn, smart_str_v(&cmd)))) {
- PHP_PQclear(res);
+ if ((res = php_pq_exec(obj->intern->conn->intern->conn, smart_str_v(&cmd)))) {
+ php_pqres_clear(res);
} else if (!silent) {
throw_exce(EX_RUNTIME, "Failed to close cursor (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
}
obj->intern->conn->intern->poller = PQconsumeInput;
}
} else {
- PGresult *res = PQexec(obj->intern->conn->intern->conn, smart_str_v(&cmd));
+ PGresult *res = php_pq_exec(obj->intern->conn->intern->conn, smart_str_v(&cmd));
if (!res) {
throw_exce(EX_RUNTIME, "Failed to %s cursor (%s)", *action == 'f' ? "fetch from" : "move in", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
}
static zend_function_entry php_pqcur_methods[] = {
- PHP_ME(pqcur, __construct, ai_pqcur___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
+ PHP_ME(pqcur, __construct, ai_pqcur___construct, ZEND_ACC_PUBLIC)
PHP_ME(pqcur, open, ai_pqcur_open, ZEND_ACC_PUBLIC)
PHP_ME(pqcur, openAsync, ai_pqcur_openAsync, ZEND_ACC_PUBLIC)
PHP_ME(pqcur, close, ai_pqcur_close, ZEND_ACC_PUBLIC)
php_pqcur_object_handlers.read_property = php_pq_object_read_prop;
php_pqcur_object_handlers.write_property = php_pq_object_write_prop;
php_pqcur_object_handlers.clone_obj = NULL;
- php_pqcur_object_handlers.get_property_ptr_ptr = NULL;
+ php_pqcur_object_handlers.get_property_ptr_ptr = php_pq_object_get_prop_ptr_null;
php_pqcur_object_handlers.get_gc = php_pq_object_get_gc;
php_pqcur_object_handlers.get_properties = php_pq_object_properties;
php_pqcur_object_handlers.get_debug_info = php_pq_object_debug_info;
ph.read = php_pqcur_object_read_query;
zend_hash_str_add_mem(&php_pqcur_object_prophandlers, "query", sizeof("query")-1, (void *) &ph, sizeof(ph));
- zend_declare_property_null(php_pqcur_class_entry, ZEND_STRL("flags"), ZEND_ACC_PUBLIC TSRMLS_CC);
+ zend_declare_property_null(php_pqcur_class_entry, ZEND_STRL("flags"), ZEND_ACC_PUBLIC);
ph.read = php_pqcur_object_read_flags;
zend_hash_str_add_mem(&php_pqcur_object_prophandlers, "flags", sizeof("flags")-1, (void *) &ph, sizeof(ph));