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

Test Failure Report for ext/pdo_odbc/tests/debug_emulated_prepares.phpt ('ODBC PDO Common: PDOStatement::debugDumpParams() with emulated prepares')

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:
8:
$stmt $db->query('SELECT 1');
9:
10:
// "Sent SQL" shouldn't display
11:
var_dump($stmt->debugDumpParams());
12:
13:
$stmt $db->prepare('SELECT :bool, :int, :string, :null');
14:
$stmt->bindValue(':bool'truePDO::PARAM_BOOL);
15:
$stmt->bindValue(':int'123PDO::PARAM_INT);
16:
$stmt->bindValue(':string''foo'PDO::PARAM_STR);
17:
$stmt->bindValue(':null'nullPDO::PARAM_NULL);
18:
$stmt->execute();
19:
20:
// "Sent SQL" should display
21:
var_dump($stmt->debugDumpParams());
22:
23:
?>
24:

Expected

SQL: [8] SELECT 1
Params:  0
NULL
SQL: [34] SELECT :bool, :int, :string, :null
Sent SQL: [26] SELECT 1, 123, 'foo', NULL
Params:  4
Key: Name: [5] :bool
paramno=-1
name=[5] ":bool"
is_param=1
param_type=5
Key: Name: [4] :int
paramno=-1
name=[4] ":int"
is_param=1
param_type=1
Key: Name: [7] :string
paramno=-1
name=[7] ":string"
is_param=1
param_type=2
Key: Name: [5] :null
paramno=-1
name=[5] ":null"
is_param=1
param_type=0
NULL

Output

SQL: [8] SELECT 1
Params:  0
NULL
SQL: [34] SELECT :bool, :int, :string, :null
Params:  4
Key: Name: [5] :bool
paramno=0
name=[5] ":bool"
is_param=1
param_type=5
Key: Name: [4] :int
paramno=1
name=[4] ":int"
is_param=1
param_type=1
Key: Name: [7] :string
paramno=2
name=[7] ":string"
is_param=1
param_type=2
Key: Name: [5] :null
paramno=3
name=[5] ":null"
is_param=1
param_type=0
NULL

Diff

# original source file: ext/pdo/tests/debug_emulated_prepares.phpt
005- Sent SQL: [26] SELECT 1, 123, 'foo', NULL
007+ paramno=0
008- paramno=-1
012+ paramno=1
013- paramno=-1
017+ paramno=2
018- paramno=-1
022+ paramno=3
023- paramno=-1

 

Generated at Sun, 12 Nov 2017 21:17:35 +0000 (8 days ago)

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