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/define3.phpt ('Test oci_define_by_name() LOB descriptor')

Script

1: <?php
2:
3:
require(dirname(__FILE__)."/connect.inc");
4:
5:
$stmtarray = array(
6:     
"drop table phpdefblobtable",
7:     
"create table phpdefblobtable (id number(10), fileimage blob)"
8:
);
9:                          
10:
oci8_test_sql_execute($c$stmtarray);
11:
12:
// Load data
13:
$stmt oci_parse ($c"insert into phpdefblobtable (id, fileimage) values (:id, empty_blob()) returning fileimage into :fileimage");
14:
$fileimage oci_new_descriptor($c,OCI_D_LOB);
15:
oci_bind_by_name($stmt,":id",$id);
16:
oci_bind_by_name($stmt,":fileimage",$fileimage,-1,OCI_B_BLOB);
17:
$id 1;
18:
oci_execute($stmtOCI_DEFAULT);
19:
$fileimage->savefile(dirname(__FILE__)."/test.gif");
20:
$data $fileimage->load();
21:
var_dump(md5($data));  // original md5
22:
oci_commit($c);
23:
24:
// New row with different data
25:
$id 2;
26:
$data strrev($data);
27:
var_dump(md5($data));
28:
oci_execute($stmtOCI_DEFAULT);
29:
$fileimage->save($data);
30:
oci_commit($c);
31:
32: echo 
"Test 1\n";
33:
$stmt oci_parse($c"SELECT fileimage FROM phpdefblobtable");
34:
var_dump(oci_define_by_name($stmt'FILEIMAGE'$f));
35:
oci_execute($stmt);
36:
37: while (
oci_fetch($stmt)) {
38:    
var_dump($f);
39:    echo 
"file md5:" md5($f->load()) . "\n";
40: }
41:
42: echo 
"Test 2\n";
43:
$stmt oci_parse($c"SELECT fileimage FROM phpdefblobtable");
44:
var_dump(oci_define_by_name($stmt'FILEIMAGE'$outdataSQLT_STR));
45:
oci_execute($stmt);
46:
47: while (
oci_fetch($stmt)) {
48:    echo 
"file md5:" md5($outdata) . "\n";
49: }
50:
51: echo 
"Test 3\n";
52:
$stmt oci_parse($c"SELECT fileimage FROM phpdefblobtable");
53:
var_dump(oci_define_by_name($stmt'FILEIMAGE'$outdataSQLT_BIN));
54:
oci_execute($stmt);
55:
56: while (
oci_fetch($stmt)) {
57:    echo 
"file md5:" md5($outdata) . "\n";
58: }
59:
60: echo 
"Test 4\n";
61:
$fid oci_new_descriptor($c,OCI_D_LOB);
62:
$stmt oci_parse($c"SELECT fileimage FROM phpdefblobtable");
63:
var_dump(oci_define_by_name($stmt'FILEIMAGE'$fid));
64:
oci_execute($stmt);
65:
66: while (
oci_fetch($stmt)) {
67:    echo 
"file md5:" md5($fid->load()) . "\n";
68: }
69:
70:
$stmtarray = array(
71:     
"drop table phpdefblobtable"
72:
);
73:                          
74:
oci8_test_sql_execute($c$stmtarray);
75:
76: echo 
"Done\n";
77:
78:
?>
79:

Expected

string(32) "614fcbba1effb7caa27ef0ef25c27fcf"
string(32) "06d4f219d946c74d748d43932cd9dcb2"
Test 1
bool(true)
object(OCI-Lob)#%d (1) {
  ["descriptor"]=>
  resource(%d) of type (oci8 descriptor)
}
file md5:614fcbba1effb7caa27ef0ef25c27fcf
object(OCI-Lob)#%d (1) {
  ["descriptor"]=>
  resource(%d) of type (oci8 descriptor)
}
file md5:06d4f219d946c74d748d43932cd9dcb2
Test 2
bool(true)

Warning: oci_fetch(): ORA-00932: %s on line %d
Test 3
bool(true)
file md5:614fcbba1effb7caa27ef0ef25c27fcf
file md5:06d4f219d946c74d748d43932cd9dcb2
Test 4
bool(true)
file md5:614fcbba1effb7caa27ef0ef25c27fcf
file md5:06d4f219d946c74d748d43932cd9dcb2
Done

Output

***********************************************************************
Fatal NI connect error 12541, connecting to:
 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))

  VERSION INFORMATION:
	TNS for Linux: Version 11.2.0.2.0 - Beta
	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
  Time: 17-JUN-2018 05:27:20
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12541
    TNS-12541: TNS:no listener
    ns secondary err code: 12560
    nt main err code: 511
    TNS-00511: No listener

Fatal error: connect.inc: Failed to connect as 'system' to 'localhost/XE': ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect.inc on line 14
    nt secondary err code: 111
    nt OS err code: 0

Diff

001+ ***********************************************************************
002+ Fatal NI connect error 12541, connecting to:
003+  (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=XE)(CID=(PROGRAM=php)(HOST=nex2.php.net)(USER=nlopess)))(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
004+ 
005+   VERSION INFORMATION:
006+ 	TNS for Linux: Version 11.2.0.2.0 - Beta
007+ 	TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.2.0 - Beta
008+   Time: 17-JUN-2018 05:27:20
009+   Tracing not turned on.
010+   Tns error struct:
011+     ns main err code: 12541
012+     TNS-12541: TNS:no listener
013+     ns secondary err code: 12560
014+     nt main err code: 511
015+     TNS-00511: No listener
001- string(32) "614fcbba1effb7caa27ef0ef25c27fcf"
002- string(32) "06d4f219d946c74d748d43932cd9dcb2"
003- Test 1
004- bool(true)
005- object(OCI-Lob)#%d (1) {
006-   ["descriptor"]=>
007-   resource(%d) of type (oci8 descriptor)
008- }
009- file md5:614fcbba1effb7caa27ef0ef25c27fcf
010- object(OCI-Lob)#%d (1) {
011-   ["descriptor"]=>
012-   resource(%d) of type (oci8 descriptor)
013- }
014- file md5:06d4f219d946c74d748d43932cd9dcb2
015- Test 2
016- bool(true)
017+ Fatal error: connect.inc: Failed to connect as 'system' to 'localhost/XE': ORA-12541: TNS:no listener in /var/php_gcov/PHP_HEAD/ext/oci8/tests/connect.inc on line 14
018+     nt secondary err code: 111
019+     nt OS err code: 0
018- Warning: oci_fetch(): ORA-00932: %s on line %d
019- Test 3
020- bool(true)
021- file md5:614fcbba1effb7caa27ef0ef25c27fcf
022- file md5:06d4f219d946c74d748d43932cd9dcb2
023- Test 4
024- bool(true)
025- file md5:614fcbba1effb7caa27ef0ef25c27fcf
026- file md5:06d4f219d946c74d748d43932cd9dcb2
027- Done

 

Generated at Mon, 18 Jun 2018 17:33:50 +0000 (2 days ago)

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