|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-03-03 15:44 UTC] everton at faccat dot br
Description:
------------
Variables with null values change to an empty string after pg_query_params. This is not reported in pg_query_params manual.
Reproduce code:
---------------
$a = pg_connect("dbname=saga3");
$b = null;
var_dump($b);
pg_query_params($a, "SELECT * FROM pais WHERE idpais = $1", array($b));
var_dump($b);
die;
Expected result:
----------------
NULL
NULL
Actual result:
--------------
NULL
string(0) ""
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 16:00:01 2025 UTC |
Marcus, please take a look at it. From what I can see, there is no sense in converting params to string as long as we don't support OUT parameters (?). So this extremely short patch fixes it: @@ -1257,7 +1257,7 @@ PHP_FUNCTION(pg_query_params) } otype = (*tmp)->type; - convert_to_string(*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);