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/xmltype_01.phpt ('Basic XMLType test')

Script

1: <?php
2:
3:
require(dirname(__FILE__)."/connect.inc");
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"drop table xtt",
9:     
"create table xtt
10:            (xt_id number, xt_spec xmltype)
11:            xmltype xt_spec store as clob"
,
12:     
"insert into xtt (xt_id, xt_spec) values
13:       (1,
14:        xmltype('<?xml version=\"1.0\"?>
15:         <Xt>
16:           <XtId>1</XtId>
17:           <Size>Big</Size>
18:           <Area>12345</Area>
19:           <Hardness>20</Hardness>
20:           <Lip>Curved</Lip>
21:           <Color>Red</Color>
22:           <Nice>N</Nice>
23:           <Compact>Tiny</Compact>
24:           <Material>Steel</Material>
25:         </Xt>'))"
26:
);
27:
28:
oci8_test_sql_execute($cstr_replace("\r"""$stmtarray));
29:
30: function 
do_query($c)
31: {
32:     
$s oci_parse($c'select XMLType.getClobVal(xt_spec)
33:                         from xtt where xt_id = 1'
);
34:     
oci_execute($s);
35:     
$row oci_fetch_row($s);
36:     
$data $row[0]->load();
37:     
var_dump($data);
38:     return(
$data);
39: }
40:
41:
// Check
42:
echo "Initial Data\n";
43:
$data do_query($c);
44:
45:
// Manipulate the data using SimpleXML
46:
$sx simplexml_load_string($data);
47:
$sx->Hardness $sx->Hardness 1;
48:
$sx->Nice 'Y';
49:
50:
// Insert changes using a temporary CLOB
51:
$s oci_parse($c'update xtt
52:                     set xt_spec = XMLType(:clob)
53:                     where xt_id = 1'
);
54:
$lob oci_new_descriptor($cOCI_D_LOB);
55:
oci_bind_by_name($s':clob'$lob, -1OCI_B_CLOB);
56:
$lob->writeTemporary($sx->asXml());
57:
oci_execute($s);
58:
$lob->close();
59:
60:
// Verify
61:
echo "Verify\n";
62:
$data do_query($c);
63:
64:
// Cleanup
65:
66:
$stmtarray = array(
67:     
"drop table xtt",
68: );
69:
70:
oci8_test_sql_execute($c$stmtarray);
71:
72: echo 
"Done\n";
73:
74:
?>
75:

Expected

Initial Data
string(250) "<?xml version="1.0"?>
		<Xt>
		  <XtId>1</XtId>
		  <Size>Big</Size>
		  <Area>12345</Area>
		  <Hardness>20</Hardness>
		  <Lip>Curved</Lip>
		  <Color>Red</Color>
		  <Nice>N</Nice>
		  <Compact>Tiny</Compact>
		  <Material>Steel</Material>
		</Xt>"
Verify
string(249) "<?xml version="1.0"?>
<Xt>
		  <XtId>1</XtId>
		  <Size>Big</Size>
		  <Area>12345</Area>
		  <Hardness>19</Hardness>
		  <Lip>Curved</Lip>
		  <Color>Red</Color>
		  <Nice>Y</Nice>
		  <Compact>Tiny</Compact>
		  <Material>Steel</Material>
		</Xt>
"
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 06:12:03
  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 06:12:03
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
016+ 
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
001- Initial Data
002- string(250) "<?xml version="1.0"?>
003- 		<Xt>
004- 		  <XtId>1</XtId>
005- 		  <Size>Big</Size>
006- 		  <Area>12345</Area>
007- 		  <Hardness>20</Hardness>
008- 		  <Lip>Curved</Lip>
009- 		  <Color>Red</Color>
010- 		  <Nice>N</Nice>
011- 		  <Compact>Tiny</Compact>
012- 		  <Material>Steel</Material>
013- 		</Xt>"
014- Verify
015- string(249) "<?xml version="1.0"?>
016- <Xt>
017- 		  <XtId>1</XtId>
018- 		  <Size>Big</Size>
019- 		  <Area>12345</Area>
020- 		  <Hardness>19</Hardness>
021- 		  <Lip>Curved</Lip>
022- 		  <Color>Red</Color>
023- 		  <Nice>Y</Nice>
024- 		  <Compact>Tiny</Compact>
025- 		  <Material>Steel</Material>
026- 		</Xt>
027- "
028- Done

 

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

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