Skip to content

Commit 060c87c

Browse files
committed
Drop some zend_string* changes
1 parent b57c346 commit 060c87c

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

ext/pgsql/pgsql.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3634,12 +3634,13 @@ static bool _php_pgsql_link_has_results(PGconn *pgsql) /* {{{ */
36343634
PHP_FUNCTION(pg_send_query)
36353635
{
36363636
zval *pgsql_link;
3637-
zend_string *query;
3637+
char *query;
3638+
size_t len;
36383639
PGconn *pgsql;
36393640
int is_non_blocking;
36403641
int ret;
36413642

3642-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rS", &pgsql_link, &query) == FAILURE) {
3643+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &pgsql_link, &query, &len) == FAILURE) {
36433644
RETURN_THROWS();
36443645
}
36453646

@@ -3660,16 +3661,16 @@ PHP_FUNCTION(pg_send_query)
36603661
}
36613662

36623663
if (is_non_blocking) {
3663-
if (!PQsendQuery(pgsql, ZSTR_VAL(query))) {
3664+
if (!PQsendQuery(pgsql, query)) {
36643665
RETURN_FALSE;
36653666
}
36663667
ret = PQflush(pgsql);
36673668
} else {
3668-
if (!PQsendQuery(pgsql, ZSTR_VAL(query))) {
3669+
if (!PQsendQuery(pgsql, query)) {
36693670
if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) {
36703671
PQreset(pgsql);
36713672
}
3672-
if (!PQsendQuery(pgsql, ZSTR_VAL(query))) {
3673+
if (!PQsendQuery(pgsql, query)) {
36733674
RETURN_FALSE;
36743675
}
36753676
}
@@ -3704,12 +3705,13 @@ PHP_FUNCTION(pg_send_query_params)
37043705
zval *pgsql_link, *pv_param_arr, *tmp;
37053706
int num_params = 0;
37063707
char **params = NULL;
3707-
zend_string *query;
3708+
char *query;
3709+
size_t query_len;
37083710
PGconn *pgsql;
37093711
int is_non_blocking;
37103712
int ret;
37113713

3712-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rSa", &pgsql_link, &query, &pv_param_arr) == FAILURE) {
3714+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsa", &pgsql_link, &query, &query_len, &pv_param_arr) == FAILURE) {
37133715
RETURN_THROWS();
37143716
}
37153717

@@ -3750,7 +3752,7 @@ PHP_FUNCTION(pg_send_query_params)
37503752
} ZEND_HASH_FOREACH_END();
37513753
}
37523754

3753-
if (PQsendQueryParams(pgsql, ZSTR_VAL(query), num_params, NULL, (const char * const *)params, NULL, NULL, 0)) {
3755+
if (PQsendQueryParams(pgsql, query, num_params, NULL, (const char * const *)params, NULL, NULL, 0)) {
37543756
_php_pgsql_free_params(params, num_params);
37553757
} else if (is_non_blocking) {
37563758
_php_pgsql_free_params(params, num_params);
@@ -3759,7 +3761,7 @@ PHP_FUNCTION(pg_send_query_params)
37593761
if ((PGG(auto_reset_persistent) & 2) && PQstatus(pgsql) != CONNECTION_OK) {
37603762
PQreset(pgsql);
37613763
}
3762-
if (!PQsendQueryParams(pgsql, ZSTR_VAL(query), num_params, NULL, (const char * const *)params, NULL, NULL, 0)) {
3764+
if (!PQsendQueryParams(pgsql, query, num_params, NULL, (const char * const *)params, NULL, NULL, 0)) {
37633765
_php_pgsql_free_params(params, num_params);
37643766
RETURN_FALSE;
37653767
}

0 commit comments

Comments
 (0)