From:
Operating system:
PHP version: Irrelevant
Package: PDO related
Bug Type: Feature/Change Request
Bug description:PDOStatement::debugDumpParams does not emit the bind parameter
value
Description:
------------
Per the PDO documentation, PDOStatement::debugDumpParams should emit the
bind parameter value. Currently however, it does not. Attached is a patch
for 5.2 (which also applies cleanly to 5.3), which emits the bind parameter
value.
Test script:
---------------
<?php
$dbh = new PDO("sqlite:test.sdb");
$calories = (int) 150; /* Force a type conversion to string */
$colour = 'red';
$sth = $dbh->prepare('SELECT 1 WHERE 1 = :calories AND 2 = :colour');
if ($sth->bindParam(':calories', $calories, PDO::PARAM_INT) !== true)
die('die on ' . __LINE__. "\n");
if ($sth->bindValue(':colour', $colour, PDO::PARAM_STR) !== true)
die('die on ' . __LINE__. "\n");
$sth->debugDumpParams();
Expected result:
----------------
With Patch:
SQL : [len = 44] SELECT 1 WHERE 1 = :calories AND 2 = :colour
Params: 2
Key: Name: [9] :calories
paramno=-1
name=[9] ":calories"
is_param=1
param_type=1
value=150
Key: Name: [7] :colour
paramno=-1
name=[7] ":colour"
is_param=1
param_type=2
value=red
Actual result:
--------------
SQL: [44] SELECT 1 WHERE 1 = :calories AND 2 = :colour
Params: 2
Key: Name: [9] :calories
paramno=-1
name=[9] ":calories"
is_param=1
param_type=1
Key: Name: [7] :colour
paramno=-1
name=[7] ":colour"
is_param=1
param_type=2
--
Edit bug report at http://bugs.php.net/bug.php?id=52384&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52384&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52384&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52384&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52384&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52384&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52384&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52384&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52384&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52384&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52384&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52384&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52384&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52384&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52384&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52384&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52384&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52384&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52384&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52384&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52384&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52384&r=mysqlcfg