The function is designed for sending data allowing it to fetch bound params can lead to all kinds of undefined behaviors such as:

pg_send_query_params($dbconn, 'select count(*) from authors where city = $1', array('Perth'));

especially when the supplied value is a temp var.




On 13-Nov-07, at 3:48 PM, Antony Dovgal wrote:

What happens if Postgres returns OUT parameters?

On 13.11.2007 23:05, Ilia Alshanetsky wrote:
@@ -4084,6 +4084,7 @@
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 @@
                        }

                        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);



--
Wbr,
Antony Dovgal

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Ilia Alshanetsky

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to