char *expr_str, *opt_str = "";
int expr_len, opt_len = 0;
long direction;
- STATUS rv;
+ ZEND_RESULT_CODE rv;
zend_replace_error_handling(EH_THROW, exce(EX_INVALID_ARGUMENT), &zeh TSRMLS_CC);
rv = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Osl|s", &zconn, php_pqconn_class_entry, &expr_str, &expr_len, &direction, &opt_str, &opt_len);
smart_str_appendl(&cmd, opt_str, opt_len);
smart_str_0(&cmd);
- res = PQexec(conn_obj->intern->conn, cmd.c);
+ res = php_pq_exec(conn_obj->intern->conn, cmd.c);
if (!res) {
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to start %s (%s)", cmd.c, PHP_PQerrorMessage(obj->intern->conn->intern->conn));
php_pq_object_addref(conn_obj TSRMLS_CC);
}
- PHP_PQclear(res);
+ php_pqres_clear(res);
}
smart_str_free(&cmd);
zend_error_handling zeh;
char *data_str;
int data_len;
- STATUS rv;
+ ZEND_RESULT_CODE rv;
zend_replace_error_handling(EH_THROW, exce(EX_INVALID_ARGUMENT), &zeh TSRMLS_CC);
rv = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &data_str, &data_len);
zend_error_handling zeh;
char *error_str = NULL;
int error_len = 0;
- STATUS rv;
+ ZEND_RESULT_CODE rv;
zend_replace_error_handling(EH_THROW, exce(EX_INVALID_ARGUMENT), &zeh TSRMLS_CC);
rv = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s!", &error_str, &error_len);
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to fetch COPY result (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
} else {
php_pqres_success(res TSRMLS_CC);
- PHP_PQclear(res);
+ php_pqres_clear(res);
}
}
static PHP_METHOD(pqcopy, get) {
zend_error_handling zeh;
zval *zdata;
- STATUS rv;
+ ZEND_RESULT_CODE rv;
zend_replace_error_handling(EH_THROW, exce(EX_INVALID_ARGUMENT), &zeh TSRMLS_CC);
rv = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zdata);
throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to fetch COPY result (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
} else {
php_pqres_success(res TSRMLS_CC);
- PHP_PQclear(res);
+ php_pqres_clear(res);
RETVAL_FALSE;
}
break;