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/num.phpt ('oci_num_*() family')

Script

1: <?php
2:
3:
require(dirname(__FILE__)."/connect.inc");
4:
5:
// Initialize
6:
7:
$stmtarray = array(
8:     
"drop table num_tab",
9:     
"create table num_tab (id number, value number)",
10: );
11:
12:
oci8_test_sql_execute($c$stmtarray);
13:
14:
// Run Test
15:
16:
echo "Test 1\n";
17:
var_dump(ocirowcount());
18:
var_dump(oci_num_rows());
19:
var_dump(ocinumcols());
20:
var_dump(oci_num_fields());
21:
22: echo 
"Test 2\n";
23:
$insert_sql "insert into num_tab (id, value) values (1,1)";
24: if (!(
$s oci_parse($c$insert_sql))) {
25:     die(
"oci_parse(insert) failed!\n");
26: }
27:
28:
var_dump(ocirowcount($s));
29:
var_dump(oci_num_rows($s));
30:
var_dump(ocinumcols($s));
31:
var_dump(oci_num_fields($s));
32:
33: for (
$i 0$i<3$i++) {
34:   if (!
oci_execute($s)) {
35:     die(
"oci_execute(insert) failed!\n");
36:   }
37: }
38:
39: echo 
"Test 3\n";
40:
var_dump(ocirowcount($s));
41:
var_dump(oci_num_rows($s));
42:
var_dump(ocinumcols($s));
43:
var_dump(oci_num_fields($s));
44:
45: if (!
oci_commit($c)) {
46:   die(
"oci_commit() failed!\n");
47: }
48:
49: echo 
"Test 4\n";
50:
var_dump(ocirowcount($s));
51:
var_dump(oci_num_rows($s));
52:
var_dump(ocinumcols($s));
53:
var_dump(oci_num_fields($s));
54:
55:
// All rows
56:
$select_sql "select * from num_tab";
57:
58: if (!(
$s oci_parse($c$select_sql))) {
59:   die(
"oci_parse(select) failed!\n");
60: }
61:
62: echo 
"Test 5a\n";
63:
var_dump(ocirowcount($s));
64:
var_dump(oci_num_rows($s));
65:
var_dump(ocinumcols($s));
66:
var_dump(oci_num_fields($s));
67:
68: if (!
oci_execute($s)) {
69:   die(
"oci_execute(select) failed!\n");
70: }
71:
72: echo 
"Test 5b\n";
73:
var_dump(ocirowcount($s));
74:
var_dump(oci_num_rows($s));
75:
var_dump(ocinumcols($s));
76:
var_dump(oci_num_fields($s));
77:
78:
79: if (
oci_fetch_all($s,$r) === false) {
80:   die(
"oci_fetch_all(select) failed!\n");
81: }
82:
83: echo 
"Test 5c\n";
84:
var_dump(ocirowcount($s));
85:
var_dump(oci_num_rows($s));
86:
var_dump(ocinumcols($s));
87:
var_dump(oci_num_fields($s));
88:
89:
// One row
90:
$select_sql "SELECT id, value FROM num_tab WHERE ROWNUM < 2";
91:
92: if (!(
$s oci_parse($c$select_sql))) {
93:   die(
"oci_parse(select) failed!\n");
94: }
95:
96: if (!
oci_execute($s)) {
97:   die(
"oci_execute(select) failed!\n");
98: }
99:
100: if (
oci_fetch_all($s,$r) === false) {
101:   die(
"oci_fetch_all(select) failed!\n");
102: }
103:
104: echo 
"Test 6\n";
105:
var_dump(ocirowcount($s));
106:
var_dump(oci_num_rows($s));
107:
var_dump(ocinumcols($s));
108:
var_dump(oci_num_fields($s));
109:
110:
// No rows
111:
$select_sql "select id from num_tab where 1=0";
112:
113: if (!(
$s oci_parse($c$select_sql))) {
114:   die(
"oci_parse(select) failed!\n");
115: }
116:
117: if (!
oci_execute($s)) {
118:   die(
"oci_execute(select) failed!\n");
119: }
120:
121: if (
oci_fetch_all($s,$r) === false) {
122:   die(
"oci_fetch_all(select) failed!\n");
123: }
124:
125: echo 
"Test 7\n";
126:
var_dump(ocirowcount($s));
127:
var_dump(oci_num_rows($s));
128:
var_dump(ocinumcols($s));
129:
var_dump(oci_num_fields($s));
130:
131:
$delete_sql "delete from num_tab";
132:
133: if (!(
$s oci_parse($c$delete_sql))) {
134:     die(
"oci_parse(delete) failed!\n");
135: }
136:
137: if (!
oci_execute($s)) {
138:     die(
"oci_execute(delete) failed!\n");
139: }
140:
141: echo 
"Test 8a\n";
142:
var_dump(ocirowcount($s));
143:
var_dump(oci_num_rows($s));
144:
var_dump(ocinumcols($s));
145:
var_dump(oci_num_fields($s));
146:
147:
148:
oci_commit($c);
149:
150: echo 
"Test 8b\n";
151:
var_dump(ocirowcount($s));
152:
var_dump(oci_num_rows($s));
153:
var_dump(ocinumcols($s));
154:
var_dump(oci_num_fields($s));
155:
156:
157:
// Cleanup
158:
159:
$stmtarray = array(
160:     
"drop table num_tab"
161:
);
162:
163:
oci8_test_sql_execute($c$stmtarray);
164:
165: echo 
"Done\n";
166:
167:
?>
168:

Expected

Test 1

Warning: ocirowcount() expects exactly 1 parameter, 0 given in %s on line %d
NULL

Warning: oci_num_rows() expects exactly 1 parameter, 0 given in %s on line %d
NULL

Warning: ocinumcols() expects exactly 1 parameter, 0 given in %s on line %d
NULL

Warning: oci_num_fields() expects exactly 1 parameter, 0 given in %s on line %d
NULL
Test 2
int(0)
int(0)
int(0)
int(0)
Test 3
int(1)
int(1)
int(0)
int(0)
Test 4
int(1)
int(1)
int(0)
int(0)
Test 5a
int(0)
int(0)
int(0)
int(0)
Test 5b
int(0)
int(0)
int(2)
int(2)
Test 5c
int(3)
int(3)
int(2)
int(2)
Test 6
int(1)
int(1)
int(2)
int(2)
Test 7
int(0)
int(0)
int(1)
int(1)
Test 8a
int(3)
int(3)
int(0)
int(0)
Test 8b
int(3)
int(3)
int(0)
int(0)
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:03:57
  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
003- Warning: ocirowcount() expects exactly 1 parameter, 0 given in %s on line %d
004- NULL
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:03:57
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
006- Warning: oci_num_rows() expects exactly 1 parameter, 0 given in %s on line %d
007- NULL
008- 
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
009- Warning: ocinumcols() expects exactly 1 parameter, 0 given in %s on line %d
010- NULL
011- 
012- Warning: oci_num_fields() expects exactly 1 parameter, 0 given in %s on line %d
013- NULL
014- Test 2
015- int(0)
016- int(0)
017- int(0)
018- int(0)
019- Test 3
020- int(1)
021- int(1)
022- int(0)
023- int(0)
024- Test 4
025- int(1)
026- int(1)
027- int(0)
028- int(0)
029- Test 5a
030- int(0)
031- int(0)
032- int(0)
033- int(0)
034- Test 5b
035- int(0)
036- int(0)
037- int(2)
038- int(2)
039- Test 5c
040- int(3)
041- int(3)
042- int(2)
043- int(2)
044- Test 6
045- int(1)
046- int(1)
047- int(2)
048- int(2)
049- Test 7
050- int(0)
051- int(0)
052- int(1)
053- int(1)
054- Test 8a
055- int(3)
056- int(3)
057- int(0)
058- int(0)
059- Test 8b
060- int(3)
061- int(3)
062- int(0)
063- int(0)
064- Done

 

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

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