com php-src: Fixed bug #72028 (pg_query_params(): NULL converts to empty string): NEWS ext/pgs ql/pgsql.c
| From: | Xinchen Hui | Date: | Sat, 16 Apr 2016 04:29:27 +0000 |
| Subject: | com php-src: Fixed bug #72028 (pg_query_params(): NULL converts to empty string): NEWS ext/pgs ql/pgsql.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91733@lists.php.net to get a copy of this message | ||
Commit: 7e01c518b6a504846f397b787ab285105531d562
Author: Xinchen Hui <laruence@gmail.com> Fri, 15 Apr 2016 21:29:27 -0700
Parents: 05d53dee7d70a94c0cef57ae2dae735f98a3d833
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7e01c518b6a504846f397b787ab285105531d562
Log:
Fixed bug #72028 (pg_query_params(): NULL converts to empty string)
I don't have a pgsql server by hand, so no test script, but the fix must
be right.
Bugs:
https://bugs.php..net/72028
Changed paths:
M NEWS
M ext/pgsql/pgsql.c
Diff:
diff --git a/NEWS b/NEWS
index 20821fe..493c636 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ PHP NEWS
leads to fatal error). (Laruence)
- Postgres:
+ . Fixed bug #72028 (pg_query_params(): NULL converts to empty string).
+ (Laruence)
. Fixed bug #71062 (pg_convert() doesn't accept ISO 8601 for datatype
timestamp). (denver at timothy dot io)
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 84a443e..c22a23e 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -1968,7 +1968,7 @@ PHP_FUNCTION(pg_query_params)
params = (char **)safe_emalloc(sizeof(char *), num_params, 0);
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(pv_param_arr), tmp) {
-
+ ZVAL_DEREF(tmp);
if (Z_TYPE_P(tmp) == IS_NULL) {
params[i] = NULL;
} else {