PHP  
 PHP_7_0
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/pdo_firebird/tests/bug_69356.phpt ('FIREBIRD PDO Common: Bug #69356 (PDOStatement::debugDumpParams() truncates query)')

Script

1: <?php
2:
if (getenv('REDIR_TEST_DIR') === falseputenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
3: require_once 
getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4:
5:
$db PDOTest::factory();
6:
$db->setAttribute(PDO::ATTR_EMULATE_PREPAREStrue);
7:
$stmt $db->query("
8:     SELECT '
9:         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).
10:         This is a debug function, which dump directly the data on the normal output.
11:         Tip:
12:         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).
13:         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.
14:     '
15: "
);
16:
var_dump($stmt->debugDumpParams());
17:
?>
18:

Expected

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

Output

Warning: PDO::query(): SQLSTATE[HY000]: General error: -104 Dynamic SQL Error SQL error code = -104 Unexpected end of command - line 8, column 12  in /var/php_gcov/PHP_7_0/ext/pdo_firebird/tests/bug_69356.php on line 7

Fatal error: Uncaught Error: Call to a member function debugDumpParams() on boolean in /var/php_gcov/PHP_7_0/ext/pdo_firebird/tests/bug_69356.php:16
Stack trace:
#0 {main}
  thrown in /var/php_gcov/PHP_7_0/ext/pdo_firebird/tests/bug_69356.php on line 16

Diff

# original source file: ext/pdo/tests/bug_69356.phpt
001+ Warning: PDO::query(): SQLSTATE[HY000]: General error: -104 Dynamic SQL Error SQL error code = -104 Unexpected end of command - line 8, column 12  in /var/php_gcov/PHP_7_0/ext/pdo_firebird/tests/bug_69356.php on line 7
002+ 
003+ Fatal error: Uncaught Error: Call to a member function debugDumpParams() on boolean in /var/php_gcov/PHP_7_0/ext/pdo_firebird/tests/bug_69356.php:16
004+ Stack trace:
005+ #0 {main}
006+   thrown in /var/php_gcov/PHP_7_0/ext/pdo_firebird/tests/bug_69356.php on line 16
001- SQL: [835] 
002-     SELECT '
003-         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).
004-         This is a debug function, which dump directly the data on the normal output.
005-         Tip:
006-         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).
007-         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.
008-     '
009- 
010- Params:  0
011- NULL

 

Generated at Wed, 08 Nov 2017 19:36:35 +0000 (8 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.