PHP  
 PHP_5_4
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_34630.phpt ('FIREBIRD PDO Common: Bug #34630 (inserting streams as LOBs)')

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:
$db PDOTest::factory();
5:
6:
$driver $db->getAttribute(PDO::ATTR_DRIVER_NAME);
7:
$is_oci $driver == 'oci';
8:
9: if (
$is_oci) {
10:     
$db->exec('CREATE TABLE test (id int NOT NULL PRIMARY KEY, val BLOB)');
11: } else {
12:     
$db->exec('CREATE TABLE test (id int NOT NULL PRIMARY KEY, val VARCHAR(256))');
13: }
14:
$db->setAttribute(PDO::ATTR_ERRMODEPDO::ERRMODE_EXCEPTION);
15:
16:
$fp tmpfile();
17:
fwrite($fp"I am the LOB data");
18:
rewind($fp);
19:
20: if (
$is_oci) {
21:     
/* oracle is a bit different; you need to initiate a transaction otherwise
22:      * the empty blob will be committed implicitly when the statement is
23:      * executed */
24:     
$db->beginTransaction();
25:     
$insert $db->prepare("insert into test (id, val) values (1, EMPTY_BLOB()) RETURNING val INTO :blob");
26: } else {
27:     
$insert $db->prepare("insert into test (id, val) values (1, :blob)");
28: }
29:
$insert->bindValue(':blob'$fpPDO::PARAM_LOB);
30:
$insert->execute();
31:
$insert null;
32:
33:
$db->setAttribute(PDO::ATTR_STRINGIFY_FETCHEStrue);
34:
var_dump($db->query("SELECT * from test")->fetchAll(PDO::FETCH_ASSOC));
35:
36:
?>
37:

Expected

array(1) {
  [0]=>
  array(2) {
    ["id"]=>
    string(1) "1"
    ["val"]=>
    string(17) "I am the LOB data"
  }
}

Output

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY105]: Invalid parameter type: -999 Binding arrays/objects is not supported' in /var/php_gcov/PHP_5_4/ext/pdo_firebird/tests/bug_34630.php:30
Stack trace:
#0 /var/php_gcov/PHP_5_4/ext/pdo_firebird/tests/bug_34630.php(30): PDOStatement->execute()
#1 {main}
  thrown in /var/php_gcov/PHP_5_4/ext/pdo_firebird/tests/bug_34630.php on line 30

Diff

# original source file: ext/pdo/tests/bug_34630.phpt
001+ Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY105]: Invalid parameter type: -999 Binding arrays/objects is not supported' in /var/php_gcov/PHP_5_4/ext/pdo_firebird/tests/bug_34630.php:30
002+ Stack trace:
003+ #0 /var/php_gcov/PHP_5_4/ext/pdo_firebird/tests/bug_34630.php(30): PDOStatement->execute()
004+ #1 {main}
005+   thrown in /var/php_gcov/PHP_5_4/ext/pdo_firebird/tests/bug_34630.php on line 30
001- array(1) {
002-   [0]=>
003-   array(2) {
004-     ["id"]=>
005-     string(1) "1"
006-     ["val"]=>
007-     string(17) "I am the LOB data"
008-   }
009- }

 

Generated at Thu, 16 Oct 2014 05:27:17 +0000 (4 days ago)

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