X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=src%2Fphp_pqcur.c;h=682b78aa01d8828bfd8a7823e46692cddc455907;hp=7a96994f9a14a38db27a076ae2d9bf3eae3aac32;hb=c753ebfed3a4b21409cfa46212fd2c55227c809f;hpb=9e4e6b948aa03c04e66e808efa6a3522b92449d8 diff --git a/src/php_pqcur.c b/src/php_pqcur.c index 7a96994..682b78a 100644 --- a/src/php_pqcur.c +++ b/src/php_pqcur.c @@ -47,8 +47,8 @@ static void cur_close(php_pqcur_object_t *obj, zend_bool async, zend_bool silent 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)); } @@ -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, 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)); @@ -460,7 +460,7 @@ PHP_MINIT_FUNCTION(pqcur) 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));