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/define6.phpt ('oci_define_by_name tests with REF CURSORs')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/connect.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"drop table define6_tab",
9:     
"create table define6_tab (id number)",
10:     
"insert into define6_tab values (1)"
11:
);
12:
13:
oci8_test_sql_execute($c$stmtarray);
14:
15:
// Run Test
16:
17:
$sql 
18:
"DECLARE
19:   TYPE curtype IS REF CURSOR;
20:   cursor_var curtype;
21: BEGIN
22:   OPEN cursor_var FOR SELECT id FROM define6_tab;
23:   :curs := cursor_var;
24: END;"
;
25:
26: echo 
"Test 1 - define last\n";
27:
28:
$s1 oci_parse($c$sql);
29:
$cursor1 oci_new_cursor($c);
30:
oci_bind_by_name($s1":curs"$cursor1, -1OCI_B_CURSOR);
31:
oci_execute($s1);
32:
oci_execute($cursor1);
33:
oci_define_by_name($cursor1'ID'$id1);
34: while (
oci_fetch_row($cursor1)) {
35:     
var_dump($id1);
36: }
37:
38:
39: echo 
"Test 2 - define last with preset var\n";
40:
41:
$s2 oci_parse($c$sql);
42:
$cursor2 oci_new_cursor($c);
43:
oci_bind_by_name($s2":curs"$cursor2, -1OCI_B_CURSOR);
44:
oci_execute($s2);
45:
oci_execute($cursor2);
46:
$id2 '';
47:
oci_define_by_name($cursor2'ID'$id2);
48: while (
oci_fetch_row($cursor2)) {
49:     
var_dump($id2);
50: }
51:
52:
53: echo 
"Test 3 - define before cursor execute\n";
54:
55:
$s3 oci_parse($c$sql);
56:
$cursor3 oci_new_cursor($c);
57:
oci_bind_by_name($s3":curs"$cursor3, -1OCI_B_CURSOR);
58:
oci_execute($s3);
59:
oci_define_by_name($cursor3'ID'$id3);
60:
oci_execute($cursor3);
61: while (
oci_fetch_row($cursor3)) {
62:     
var_dump($id3);
63: }
64:
65:
66: echo 
"Test 4 - define before top level execute\n";
67:
68:
$s4 oci_parse($c$sql);
69:
$cursor4 oci_new_cursor($c);
70:
oci_bind_by_name($s4":curs"$cursor4, -1OCI_B_CURSOR);
71:
oci_define_by_name($cursor4'ID'$id4);
72:
oci_execute($s4);
73:
oci_execute($cursor4);
74: while (
oci_fetch_row($cursor4)) {
75:     
var_dump($id4);
76: }
77:
78:
79: echo 
"Test 5 - define before bind\n";
80:
81:
$s5 oci_parse($c$sql);
82:
$cursor5 oci_new_cursor($c);
83:
oci_define_by_name($cursor5'ID'$id5);
84:
oci_bind_by_name($s5":curs"$cursor5, -1OCI_B_CURSOR);
85:
oci_execute($s5);
86:
oci_execute($cursor5);
87: while (
oci_fetch_row($cursor5)) {
88:     
var_dump($id5);
89: }
90:
91:
92: echo 
"Test 6 - fetch on wrong handle\n";
93:
94:
$s6 oci_parse($c$sql);
95:
$cursor6 oci_new_cursor($c);
96:
oci_define_by_name($cursor6'ID'$id6);
97:
oci_bind_by_name($s6":curs"$cursor6, -1OCI_B_CURSOR);
98:
oci_execute($s6);
99:
oci_execute($cursor6);
100: while (
oci_fetch_row($s6)) {
101:     
var_dump($id6);
102: }
103:
104:
105:
// Clean up
106:
107:
$stmtarray = array(
108:     
"drop table define6_tab"
109:
);
110:
111:
oci8_test_sql_execute($c$stmtarray);
112:
113:
?>
114:
===DONE===
115:

Expected

Test 1 - define last
NULL
Test 2 - define last with preset var
string(0) ""
Test 3 - define before cursor execute
string(1) "1"
Test 4 - define before top level execute
string(1) "1"
Test 5 - define before bind
string(1) "1"
Test 6 - fetch on wrong handle

Warning: oci_fetch_row(): ORA-24374: %s in %sdefine6.php on line %d
===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:28:05
  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:28:05
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- Test 1 - define last
002- NULL
003- Test 2 - define last with preset var
004- string(0) ""
005- Test 3 - define before cursor execute
006- string(1) "1"
007- Test 4 - define before top level execute
008- string(1) "1"
009- Test 5 - define before bind
010- string(1) "1"
011- Test 6 - fetch on wrong handle
013- Warning: oci_fetch_row(): ORA-24374: %s in %sdefine6.php on line %d
014- ===DONE===
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

 

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

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