php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46294 pg_send_query_params converts all elements in 'params' to strings
Submitted: 2008-10-14 22:32 UTC Modified: 2008-10-15 17:59 UTC
From: rob dot linton at donatgroup dot com Assigned:
Status: Closed Package: PostgreSQL related
PHP Version: 5.2.6 OS: Windows XP
Private report: No CVE-ID: None
 [2008-10-14 22:32 UTC] rob dot linton at donatgroup dot com
Description:
------------
This is just as described here:
http://bugs.php.net/bug.php?id=43279

Variables passed into the $params array of pg_send_query_params() are converted to strings as if they were passed by reference.

Reproduce code:
---------------
$pg = pg_connect();
$int = null;
$int2 = 99;

echo '$int = '.var_export($int, true).'<br />';
echo '$int2 = '.var_export($int2, true).'<br /><br />';

$q = 'INSERT INTO val (val_int, val_int2) VALUES($1, $2)';
pg_send_query_params($pg, $q, array($int,$int2));
$result = pg_get_result($pg);

echo '$int = '.var_export($int, true).'<br />';
echo '$int2 = '.var_export($int2, true).'<br /><br />';

Expected result:
----------------
$int = NULL
$int2 = 99

$int = NULL
$int2 = 99

Actual result:
--------------
$int = NULL
$int2 = 99

$int = ''
$int2 = '99'


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-14 22:41 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2008-10-15 13:42 UTC] felipe@php.net
I can't reproduce it.
 [2008-10-15 17:59 UTC] rob dot linton at donatgroup dot com
This has been fixed in 5.3.0alpha3-dev.

Sorry for the noise.
 [2008-10-15 17:59 UTC] rob dot linton at donatgroup dot com
closing.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 05:01:31 2024 UTC