From 37b3d701e3bb6e3d9f34fa2356c9c9407ed5e81b Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 13 Nov 2007 20:05:47 +0000 Subject: [PATCH] Fixed bug #43279 (pg_send_query_params() converts all elements in 'params' to strings) --- ext/pgsql/pgsql.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 4a405471a7..f18e859e6b 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -4084,6 +4084,7 @@ PHP_FUNCTION(pg_send_query_params) php_error_docref(NULL TSRMLS_CC, E_NOTICE, "There are results on this connection. Call pg_get_result() until it returns FALSE"); } + SEPARATE_ZVAL(pv_param_arr); zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr)); num_params = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr)); if (num_params > 0) { @@ -4098,7 +4099,8 @@ PHP_FUNCTION(pg_send_query_params) } otype = (*tmp)->type; - convert_to_string(*tmp); + SEPARATE_ZVAL(tmp); + convert_to_string_ex(tmp); if (Z_TYPE_PP(tmp) != IS_STRING) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter"); _php_pgsql_free_params(params, num_params); -- 2.50.1