Bug #69356 [Opn->Csd]: PDO debugDumpParams truncate query

From: Date: Thu, 29 Jun 2017 09:40:27 +0000
Subject: Bug #69356 [Opn->Csd]: PDO debugDumpParams truncate query
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209726@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69356&edit=1 ID: 69356 Updated by: adambaratz@php.net Reported by: cn007b at gmail dot com Summary: PDO debugDumpParams truncate query -Status: Open +Status: Closed Type: Bug Package: PDO MySQL Operating System: Ubuntu 14.04 PHP Version: 5.5.23 Block user comment: N Private report: N New Comment: Automatic comment on behalf of adambaratz Revision: http://git.php.net/?p=php-src.git;a=commit;h=08089f014cee7a43fac9ee75d677fcb93c0a5297 Log: Fixed #69356: PDOStatement::debugDumpParams() truncates query Previous Comments: ------------------------------------------------------------------------ [2017-05-05 10:10:37] marc at gutt dot it 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. ------------------------------------------------------------------------ [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

« previous php.bugs (#209726) next »