Re: com php-src: Bug #46408: Fix double formatting for PostgreSQL bound parameters: NEWS Zend/zend_operators.c Zend/zend_operators.h ext/pgsql/pgsql.c
ext/pgsql/tests/bug46408.phpt
| From: | Adam Harvey | Date: | Tue, 15 Jan 2013 02:17:06 +0000 |
| Subject: | Re: com php-src: Bug #46408: Fix double formatting for PostgreSQL bound parameters: NEWS Zend/zend_operators.c Zend/zend_operators.h ext/pgsql/pgsql.c ext/pgsql/tests/bug46408.phpt |
||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-70955@lists.php.net to get a copy of this message | ||
On 15 January 2013 04:23, Lars Strojny <lstrojny@php.net> wrote:
> diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
> index bccccd9..274893c 100644
> --- a/Zend/zend_operators.c
> +++ b/Zend/zend_operators.c
> @@ -572,6 +572,24 @@ ZEND_API void convert_to_boolean(zval *op) /* {{{ */
> }
> /* }}} */
>
> +ZEND_API void _convert_to_cstring(zval *op ZEND_FILE_LINE_DC) /* {{{ */
> +{
> + double dval;
> + switch (Z_TYPE_P(op)) {
> + case IS_DOUBLE: {
> + TSRMLS_FETCH();
> + dval = Z_DVAL_P(op);
> + Z_STRLEN_P(op) = zend_spprintf(&Z_STRVAL_P(op), 0,
> "%.*H", (int) EG(precision), dval);
> + /* %H already handles removing trailing zeros from the fractional part,
> yay */
> + break;
> + }
> + default:
> + return _convert_to_string(op);
> + }
> + Z_TYPE_P(op) = IS_STRING;
> +}
> +/* }}} */
> +
> ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
> {
> long lval;
This broke compilation — specifically, the default: code path. I've
opened https://github.com/php/php-src/pull/261
to fix this, if someone
with Zend karma would be so kind.
Thanks,
Adam