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/imp_res_field.phpt ('Oracle Database 12c Implicit Result Sets: field tests')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/connect.inc');
4:
5:
// Initialization
6:
7:
$stmtarray = array(
8:     
"drop table imp_res_field_tab_1",
9:     
"create table imp_res_field_tab_1 (c1_number number, c2_varchar210 varchar2(10))",
10:     
"insert into imp_res_field_tab_1 values (1111, 'abcde')",
11:
12:     
"drop table imp_res_field_tab_2",
13:     
"create table imp_res_field_tab_2 (c3_varchar21 varchar2(4))",
14:     
"insert into imp_res_field_tab_2 values ('tttt')",
15:
16:     
"drop table imp_res_field_tab_3",
17:     
"create table imp_res_field_tab_3 (c4_number52 number(5,2))",
18:     
"insert into imp_res_field_tab_3 values (33)",
19:     
"insert into imp_res_field_tab_3 values (NULL)",
20:
21:     
"create or replace procedure imp_res_field_proc as
22:       c1 sys_refcursor;
23:     begin
24:       open c1 for select * from imp_res_field_tab_1 order by 1;
25:       dbms_sql.return_result(c1);
26:
27:       open c1 for select * from imp_res_field_tab_2 order by 1;
28:       dbms_sql.return_result(c1);
29:
30:       open c1 for select * from imp_res_field_tab_3 order by 1;
31:       dbms_sql.return_result(c1);
32:     end;"
33:
);
34:
35:
oci8_test_sql_execute($c$stmtarray);
36:
37: function 
print_fields($s)
38: {
39:     echo 
"num fields : " oci_num_fields($s) . "\n";
40:     for (
$i 1$i <= oci_num_fields($s); $i++) {
41:         
$is_null oci_field_is_null($s$i) ? "T" "F";
42:         
$name oci_field_name($s$i);
43:         
$precision oci_field_precision($s$i);
44:         
$scale oci_field_scale($s$i);
45:         
$size oci_field_size($s$i);
46:         
$typeraw oci_field_type_raw($s$i);
47:         
$type oci_field_type($s$i);
48:         echo 
"$name\t: is_null $is_null, precision $precision, scale $scale, size $size, typeraw $typeraw, type $type\n";
49:     }
50: }
51:
52:
// Run Test
53:
54:
echo "Test 1 - can't get IRS fields from parent\n";
55:
$s oci_parse($c"begin imp_res_field_proc(); end;");
56:
oci_execute($s);
57:
print_fields($s);
58:
59: echo 
"\nTest 2 - can't get IRS fields from parent when fetching\n";
60:
$s oci_parse($c"begin imp_res_field_proc(); end;");
61:
oci_execute($s);
62: while ((
$r oci_fetch_row($s))) {
63:     
var_dump($r);
64:     
print_fields($s);
65: }
66:
67: echo 
"\nTest 3 - get IRS fields\n";
68:
$s oci_parse($c"begin imp_res_field_proc(); end;");
69:
oci_execute($s);
70: while ((
$s1 oci_get_implicit_resultset($s))) {
71:     
print_fields($s1);
72: }
73:
74: echo 
"\nTest 4 - get IRS fields before fetching rows\n";
75:
$s oci_parse($c"begin imp_res_field_proc(); end;");
76:
oci_execute($s);
77:
$i 0;
78: while ((
$s1 oci_get_implicit_resultset($s))) {
79:     echo 
"===> Result set ".++$i."\n";
80:     
print_fields($s1);
81:     while ((
$r oci_fetch_row($s1)) !== false) {
82:         
var_dump($r);
83:     }
84: }
85:
86: echo 
"\nTest 5 - get IRS fields when fetching rows\n";
87:
$s oci_parse($c"begin imp_res_field_proc(); end;");
88:
oci_execute($s);
89:
$i 0;
90: while ((
$s1 oci_get_implicit_resultset($s))) {
91:     echo 
"===> Result set ".++$i."\n";
92:     while ((
$r oci_fetch_row($s1)) !== false) {
93:         
var_dump($r);
94:         
print_fields($s1);
95:     }
96: }
97:
98:
// Clean up
99:
100:
$stmtarray = array(
101:     
"drop procedure imp_res_field_proc",
102:     
"drop table imp_res_field_tab_1",
103:     
"drop table imp_res_field_tab_2",
104:     
"drop table imp_res_field_tab_3"
105:
);
106:
107:
oci8_test_sql_execute($c$stmtarray);
108:
109:
?>
110:
===DONE===
111:

Expected

Test 1 - can't get IRS fields from parent
num fields : 0

Test 2 - can't get IRS fields from parent when fetching
array(2) {
  [0]=>
  string(4) "1111"
  [1]=>
  string(5) "abcde"
}
num fields : 0
array(1) {
  [0]=>
  string(4) "tttt"
}
num fields : 0
array(1) {
  [0]=>
  string(2) "33"
}
num fields : 0
array(1) {
  [0]=>
  NULL
}
num fields : 0

Test 3 - get IRS fields
num fields : 2
C1_NUMBER	: is_null F, precision 0, scale -127, size 22, typeraw 2, type NUMBER
C2_VARCHAR210	: is_null F, precision 0, scale 0, size 10, typeraw 1, type VARCHAR2
num fields : 1
C3_VARCHAR21	: is_null F, precision 0, scale 0, size 4, typeraw 1, type VARCHAR2
num fields : 1
C4_NUMBER52	: is_null F, precision 5, scale 2, size 22, typeraw 2, type NUMBER

Test 4 - get IRS fields before fetching rows
===> Result set 1
num fields : 2
C1_NUMBER	: is_null F, precision 0, scale -127, size 22, typeraw 2, type NUMBER
C2_VARCHAR210	: is_null F, precision 0, scale 0, size 10, typeraw 1, type VARCHAR2
array(2) {
  [0]=>
  string(4) "1111"
  [1]=>
  string(5) "abcde"
}
===> Result set 2
num fields : 1
C3_VARCHAR21	: is_null F, precision 0, scale 0, size 4, typeraw 1, type VARCHAR2
array(1) {
  [0]=>
  string(4) "tttt"
}
===> Result set 3
num fields : 1
C4_NUMBER52	: is_null F, precision 5, scale 2, size 22, typeraw 2, type NUMBER
array(1) {
  [0]=>
  string(2) "33"
}
array(1) {
  [0]=>
  NULL
}

Test 5 - get IRS fields when fetching rows
===> Result set 1
array(2) {
  [0]=>
  string(4) "1111"
  [1]=>
  string(5) "abcde"
}
num fields : 2
C1_NUMBER	: is_null F, precision 0, scale -127, size 22, typeraw 2, type NUMBER
C2_VARCHAR210	: is_null F, precision 0, scale 0, size 10, typeraw 1, type VARCHAR2
===> Result set 2
array(1) {
  [0]=>
  string(4) "tttt"
}
num fields : 1
C3_VARCHAR21	: is_null F, precision 0, scale 0, size 4, typeraw 1, type VARCHAR2
===> Result set 3
array(1) {
  [0]=>
  string(2) "33"
}
num fields : 1
C4_NUMBER52	: is_null F, precision 5, scale 2, size 22, typeraw 2, type NUMBER
array(1) {
  [0]=>
  NULL
}
num fields : 1
C4_NUMBER52	: is_null T, precision 5, scale 2, size 22, typeraw 2, type NUMBER
===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:45:54
  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)))
001- Test 1 - can't get IRS fields from parent
002- num fields : 0
004- Test 2 - can't get IRS fields from parent when fetching
005- array(2) {
006-   [0]=>
007-   string(4) "1111"
008-   [1]=>
009-   string(5) "abcde"
010- }
011- num fields : 0
012- array(1) {
013-   [0]=>
014-   string(4) "tttt"
015- }
016- num fields : 0
017- array(1) {
018-   [0]=>
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:45:54
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
019-   string(2) "33"
020- }
021- num fields : 0
022- array(1) {
023-   [0]=>
024-   NULL
025- }
026- num fields : 0
027- 
028- Test 3 - get IRS fields
029- num fields : 2
030- C1_NUMBER	: is_null F, precision 0, scale -127, size 22, typeraw 2, type NUMBER
031- C2_VARCHAR210	: is_null F, precision 0, scale 0, size 10, typeraw 1, type VARCHAR2
032- num fields : 1
033- C3_VARCHAR21	: is_null F, precision 0, scale 0, size 4, typeraw 1, type VARCHAR2
034- num fields : 1
035- C4_NUMBER52	: is_null F, precision 5, scale 2, size 22, typeraw 2, type NUMBER
036- 
037- Test 4 - get IRS fields before fetching rows
038- ===> Result set 1
039- num fields : 2
040- C1_NUMBER	: is_null F, precision 0, scale -127, size 22, typeraw 2, type NUMBER
041- C2_VARCHAR210	: is_null F, precision 0, scale 0, size 10, typeraw 1, type VARCHAR2
042- array(2) {
043-   [0]=>
044-   string(4) "1111"
045-   [1]=>
046-   string(5) "abcde"
047- }
048- ===> Result set 2
049- num fields : 1
050- C3_VARCHAR21	: is_null F, precision 0, scale 0, size 4, typeraw 1, type VARCHAR2
051- array(1) {
052-   [0]=>
053-   string(4) "tttt"
054- }
055- ===> Result set 3
056- num fields : 1
057- C4_NUMBER52	: is_null F, precision 5, scale 2, size 22, typeraw 2, type NUMBER
058- array(1) {
059-   [0]=>
060-   string(2) "33"
061- }
062- array(1) {
063-   [0]=>
064-   NULL
065- }
066- 
067- Test 5 - get IRS fields when fetching rows
068- ===> Result set 1
069- array(2) {
070-   [0]=>
071-   string(4) "1111"
072-   [1]=>
073-   string(5) "abcde"
074- }
075- num fields : 2
076- C1_NUMBER	: is_null F, precision 0, scale -127, size 22, typeraw 2, type NUMBER
077- C2_VARCHAR210	: is_null F, precision 0, scale 0, size 10, typeraw 1, type VARCHAR2
078- ===> Result set 2
079- array(1) {
080-   [0]=>
081-   string(4) "tttt"
082- }
083- num fields : 1
084- C3_VARCHAR21	: is_null F, precision 0, scale 0, size 4, typeraw 1, type VARCHAR2
085- ===> Result set 3
086- array(1) {
087-   [0]=>
088-   string(2) "33"
089- }
090- num fields : 1
091- C4_NUMBER52	: is_null F, precision 5, scale 2, size 22, typeraw 2, type NUMBER
092- array(1) {
093-   [0]=>
094-   NULL
095- }
096- num fields : 1
097- C4_NUMBER52	: is_null T, precision 5, scale 2, size 22, typeraw 2, type NUMBER
098- ===DONE===

 

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

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