ID: 36606 Updated by: [EMAIL PROTECTED] Reported By: everton at faccat dot br -Status: Assigned +Status: Closed Bug Type: PostgreSQL related Operating System: Linux Slackware 9.1 PHP Version: 5.1.2 Assigned To: helly New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2006-03-05 14:02:54] [EMAIL PROTECTED] 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); ------------------------------------------------------------------------ [2006-03-03 21:43:08] everton at faccat dot br category updated ------------------------------------------------------------------------ [2006-03-03 15:44:59] 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) "" ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36606&edit=1