-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #69356: PDOStatement::debugDumpParams() truncates query
- Loading branch information
1 parent
751d19f
commit 08089f0
Showing
3 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--TEST-- | ||
PDO Common: Bug #69356 (PDOStatement::debugDumpParams() truncates query) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('pdo')) die('skip'); | ||
$dir = getenv('REDIR_TEST_DIR'); | ||
if (false == $dir) die('skip no driver'); | ||
require_once $dir . 'pdo_test.inc'; | ||
PDOTest::skip(); | ||
?> | ||
--FILE-- | ||
<?php | ||
if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); | ||
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; | ||
|
||
$db = PDOTest::factory(); | ||
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); | ||
$stmt = $db->query(" | ||
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. | ||
' | ||
"); | ||
var_dump($stmt->debugDumpParams()); | ||
?> | ||
--EXPECT-- | ||
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 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. | ||
' | ||
|
||
Params: 0 | ||
NULL |