release 1.1.1
[m6w6/ext-pq] / src / php_pqcur.c
index a81f38eea83f729ffe7b4edf95c5ada974d3ebc1..cb115167027218bf16a833e294295c05706d2320 100644 (file)
@@ -47,8 +47,8 @@ static void cur_close(php_pqcur_object_t *obj, zend_bool async, zend_bool silent
                                throw_exce(EX_IO TSRMLS_CC, "Failed to close cursor (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
                        }
                } else {
-                       if ((res = PQexec(obj->intern->conn->intern->conn, cmd.c))) {
-                               PHP_PQclear(res);
+                       if ((res = php_pq_exec(obj->intern->conn->intern->conn, cmd.c))) {
+                               php_pqres_clear(res);
                        } else if (!silent) {
                                throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to close cursor (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
                        }
@@ -133,7 +133,7 @@ static void cur_fetch_or_move(INTERNAL_FUNCTION_PARAMETERS, const char *action,
                                        obj->intern->conn->intern->poller = PQconsumeInput;
                                }
                        } else {
-                               PGresult *res = PQexec(obj->intern->conn->intern->conn, cmd.c);
+                               PGresult *res = php_pq_exec(obj->intern->conn->intern->conn, cmd.c);
 
                                if (!res) {
                                        throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to %s cursor (%s)", *action == 'f' ? "fetch from" : "move in", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
@@ -411,7 +411,7 @@ static PHP_METHOD(pqcur, moveAsync)
 static zend_function_entry php_pqcur_methods[] = {
        PHP_ME(pqcur, __construct, ai_pqcur___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
        PHP_ME(pqcur, open, ai_pqcur_open, ZEND_ACC_PUBLIC)
-       PHP_ME(pqcur, openAsync, 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_ME(pqcur, closeAsync, ai_pqcur_closeAsync, ZEND_ACC_PUBLIC)
        PHP_ME(pqcur, fetch, ai_pqcur_fetch, ZEND_ACC_PUBLIC)
@@ -445,7 +445,7 @@ PHP_MINIT_FUNCTION(pqcur)
        php_pqcur_object_handlers.get_properties = php_pq_object_properties;
        php_pqcur_object_handlers.get_debug_info = php_pq_object_debug_info;
 
-       zend_hash_init(&php_pqcur_object_prophandlers, 2, NULL, NULL, 1);
+       zend_hash_init(&php_pqcur_object_prophandlers, 4, NULL, NULL, 1);
 
        zend_declare_class_constant_long(php_pqcur_class_entry, ZEND_STRL("BINARY"), PHP_PQ_DECLARE_BINARY TSRMLS_CC);
        zend_declare_class_constant_long(php_pqcur_class_entry, ZEND_STRL("INSENSITIVE"), PHP_PQ_DECLARE_INSENSITIVE TSRMLS_CC);