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/oci8/tests/lob_002.phpt ('oci_lob_write() and friends (with errors)')

Script

1: <?php
2:
3:
require(__DIR__.'/connect.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"drop table lob_002_tab",
9:     
"create table lob_002_tab (id number, b1 BLOB)",
10: );
11:
12:
oci8_test_sql_execute($c$stmtarray);
13:
14:
$statement oci_parse($c"insert into lob_002_tab (id, b1) values (1, empty_blob()) returning b1 INTO :v_blob ");
15:
$blob oci_new_descriptor($c,OCI_D_LOB);
16:
oci_bind_by_name($statement,":v_blob"$blob,-1,OCI_B_BLOB);
17:
oci_execute($statementOCI_DEFAULT);
18:
19:
var_dump($blob);
20:
21:
var_dump($blob->write("test", -1));
22:
var_dump($blob->write("test""str"));
23:
var_dump($blob->write("test"1000000));
24:
var_dump($blob->write(str_repeat("test"10000), 1000000));
25:
var_dump($blob->tell());
26:
var_dump($blob->seek("str", -5));
27:
var_dump($blob->flush());
28:
29:
oci_commit($c);
30:
31:
$select_sql "select b1 from lob_002_tab where id = 1";
32:
$s oci_parse($c$select_sql);
33:
oci_execute($s);
34:
35:
$row oci_fetch_array($sOCI_RETURN_LOBS);
36:
37:
var_dump(strlen($row[0]));
38:
39:
// Cleanup
40:
41:
$stmtarray = array(
42:     
"drop table lob_002_tab"
43:
);
44:
45:
oci8_test_sql_execute($c$stmtarray);
46:
47:
?>
48:
===DONE===
49:

Expected

object(OCI-Lob)#%d (1) {
  ["descriptor"]=>
  resource(%d) of type (oci8 descriptor)
}
int(0)

Warning: OCI-Lob::write() expects parameter 2 to be int%s string given in %slob_002.php on line %d
NULL
int(4)
int(40000)
int(40004)

Warning: OCI-Lob::seek() expects parameter 1 to be int%s string given in %slob_002.php on line %d
NULL
bool(false)
int(40004)
===DONE===

Output

object(OCI-Lob)#1 (1) {
  ["descriptor"]=>
  resource(10) of type (oci8 descriptor)
}
int(0)

Fatal error: Uncaught TypeError: OCI-Lob::write() expects parameter 2 to be int, string given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/lob_002.php:22
Stack trace:
#0 /var/php_gcov/PHP_HEAD/ext/oci8/tests/lob_002.php(22): OCI-Lob->write('test', 'str')
#1 {main}
  thrown in /var/php_gcov/PHP_HEAD/ext/oci8/tests/lob_002.php on line 22

Diff

007+ Fatal error: Uncaught TypeError: OCI-Lob::write() expects parameter 2 to be int, string given in /var/php_gcov/PHP_HEAD/ext/oci8/tests/lob_002.php:22
008+ Stack trace:
009+ #0 /var/php_gcov/PHP_HEAD/ext/oci8/tests/lob_002.php(22): OCI-Lob->write('test', 'str')
010+ #1 {main}
011+   thrown in /var/php_gcov/PHP_HEAD/ext/oci8/tests/lob_002.php on line 22
007- Warning: OCI-Lob::write() expects parameter 2 to be int%s string given in %slob_002.php on line %d
008- NULL
009- int(4)
010- int(40000)
011- int(40004)
012- 
013- Warning: OCI-Lob::seek() expects parameter 1 to be int%s string given in %slob_002.php on line %d
014- NULL
015- bool(false)
016- int(40004)
017- ===DONE===

 

Generated at Mon, 06 May 2019 17:58:35 +0000 (942 days ago)

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