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') === false) putenv('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_ERRMODE, PDO::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', $fp, PDO::PARAM_LOB); 30: $insert->execute(); 31: $insert = null; 32: 33: $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); 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_HEAD/ext/pdo_firebird/tests/bug_34630.php:30
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/pdo_firebird/tests/bug_34630.php(30): PDOStatement->execute()
#1 {main}
thrown in /var/php_gcov/PHP_HEAD/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_HEAD/ext/pdo_firebird/tests/bug_34630.php:30
002+ Stack trace:
003+ #0 /var/php_gcov/PHP_HEAD/ext/pdo_firebird/tests/bug_34630.php(30): PDOStatement->execute()
004+ #1 {main}
005+ thrown in /var/php_gcov/PHP_HEAD/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 Fri, 17 May 2013 23:23:52 +0000 (26 hours ago)
|