diff options
author | Ondřej Surý <ondrej@sury.org> | 2013-02-19 13:28:10 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2013-02-19 13:28:10 +0100 |
commit | 54098cf044025ec5965b8ea9c84750f9631d85b6 (patch) | |
tree | ed0ef32b379c0cdfe20fcafc5b27c4488732fe90 /ext/pgsql | |
parent | 8572aeb0703107705fc7dde35961cd6a5f89c0c8 (diff) | |
download | php-upstream/5.5.0_alpha4.tar.gz |
Imported Upstream version 5.5.0~alpha4upstream/5.5.0_alpha4
Diffstat (limited to 'ext/pgsql')
-rw-r--r-- | ext/pgsql/pgsql.c | 2 | ||||
-rw-r--r-- | ext/pgsql/tests/bug46408.phpt | 23 |
2 files changed, 24 insertions, 1 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index d01dda603..7ee838a9f 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1736,7 +1736,7 @@ PHP_FUNCTION(pg_query_params) } else { zval tmp_val = **tmp; zval_copy_ctor(&tmp_val); - convert_to_string(&tmp_val); + convert_to_cstring(&tmp_val); if (Z_TYPE(tmp_val) != IS_STRING) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting parameter"); zval_dtor(&tmp_val); diff --git a/ext/pgsql/tests/bug46408.phpt b/ext/pgsql/tests/bug46408.phpt new file mode 100644 index 000000000..8c72ba5f3 --- /dev/null +++ b/ext/pgsql/tests/bug46408.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #46408 (Locale number format settings can cause pg_query_params to break with numerics) +--SKIPIF-- +<?php +require_once('skipif.inc'); +?> +--FILE-- +<?php + +require_once('config.inc'); + +$dbh = pg_connect($conn_str); +setlocale(LC_ALL, 'hr_HR.utf-8', 'hr_HR'); +echo 3.5.PHP_EOL; +pg_query_params("SELECT $1::numeric", array(3.5)); +pg_close($dbh); + +echo "Done".PHP_EOL; + +?> +--EXPECTF-- +3,5 +Done |