Bug #69356 [Com]: PDO debugDumpParams truncate query
Edit report at https://bugs.php.net/bug.php?id=69356&edit=1
ID: 69356
Comment by: marc at gutt dot it
Reported by: cn007b at gmail dot com
Summary: PDO debugDumpParams truncate query
Status: Open
Type: Bug
Package: PDO MySQL
Operating System: Ubuntu 14.04
PHP Version: 5.5.23
Block user comment: N
Private report: N
New Comment:
There should be an option to disable the truncation. And of course it should be possible to get the
result as an array. At the moment the function is really useless for debugging.
Previous Comments:
------------------------------------------------------------------------
[2015-04-02 11:47:27] cn007b at gmail dot com
Description:
------------
PDO debugDumpParams truncate query:
http://stackoverflow.com/questions/29410151/why-pdo-debugdumpparams-truncate-query
Test script:
---------------
<?php
$dbh = new PDO('mysql:dbname=test;host=127.0.0.1', 'root');
$sth = $dbh->prepare("
SELECT '
Dumps the informations contained by a prepared statement directly on the output. It will
provide the SQL query in use, the number of parameters used (Params), the list of parameters, with
their name, type (paramtype) as an integer, their key name or position, and the position in the
query (if this is supported by the PDO driver, otherwise, it will be -1).
This is a debug function, which dump directly the data on the normal output.
Tip:
As with anything that outputs its result directly to the browser, the output-control
functions can be used to capture the output of this function, and save it in a string (for example).
This will only dumps the parameters in the statement at the moment of the dump. Extra
parameters are not stored in the statement, and not displayed.
'
");
$sth->execute();
$sth->debugDumpParams();
Actual result:
--------------
SQL: [835]
SELECT '
Dumps the informations contained by a prepared statement directly on the output. It will
provide the SQL query in use, the number of parameters used (Params), the list of parameters, with
their name, type (paramtype) as an integer, their key name or position, and the position in the
query (if this is supported by the PDO driver, otherwise, it will be -1).
This is a debug function, which dump directly the data on the normal output.
Tip:
As with anythi
Params: 0
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69356&edit=1
Thread (4 messages)