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/refcur_prefetch_3.phpt ('Prefetch with Nested cursors with INI setting.')

Script

1: <?php
2:
require dirname(__FILE__)."/connect.inc";
3:
4:
//Create tables here
5:
$stmtarray = array(
6:     
"drop table nescurtest",
7:     
"create table nescurtest(c1 varchar2(10))"
8:
);
9:
10:
oci8_test_sql_execute($c$stmtarray);
11:
12:
// Insert 500 rows into the table.
13:
$insert_sql "INSERT INTO nescurtest (c1) VALUES (:c1)";
14: if (!(
$s oci_parse($c$insert_sql))) {
15:     die(
"oci_parse(insert) failed!\n");
16: }
17:
18: for (
$i 0$i<=500$i++) {
19:     
$val2 'test'.$i;
20:     
oci_bind_by_name($s,':c1',$val2);
21:     if (!
oci_execute($s)) {
22:         die(
"oci_execute(insert) failed!\n");
23:     }
24: }
25:
26: echo
"-----------------------------------------------\n";
27: echo 
"Test with Nested Cursors\n";
28: echo
"-----------------------------------------------\n";
29:
$cur1 oci_new_cursor($c);
30:
$sqlstmt "select cursor(select * from nescurtest) curs1 from dual";
31:
$s oci_parse($c,$sqlstmt);
32:
oci_execute($s);
33:
$data oci_fetch_array($s);
34:
oci_execute($data['CURS1']);
35:
36:
// Calculate round-trips 
37:
$initial_rt print_roundtrips($c);
38: for (
$i 0;$i<10;$i++) {
39:     echo 
"Fetch Row using Nested cursor Query\n";
40:     
var_dump(oci_fetch_row($data['CURS1']));
41: }
42:
43:
$cnt = (print_roundtrips($c) - $initial_rt);
44: echo 
"Number of roundtrips made with prefetch count 5 for 10 rows is  $cnt\n";
45:
46: function  
print_roundtrips($c) {
47:     
$sql_stmt "select value from v\$mystat a,v\$statname c where
48:          a.statistic#=c.statistic# and c.name='SQL*Net roundtrips to/from client'"
;
49:     
$s oci_parse($c,$sql_stmt);
50:     
oci_define_by_name($s,"VALUE",$value);
51:     
oci_execute($s);
52:     
oci_fetch($s);
53:     return 
$value;
54: }
55:
56:
// Clean up  here
57:
58:
$stmtarray = array(
59:     
"drop table nescurtest"
60:
);
61:
62:
oci8_test_sql_execute($c$stmtarray);
63:
64: echo 
"Done\n";
65:
?>
66:

Expected

-----------------------------------------------
Test with Nested Cursors
-----------------------------------------------
Fetch Row using Nested cursor Query
array(1) {
  [0]=>
  string(%d) "test0"
}
Fetch Row using Nested cursor Query
array(1) {
  [0]=>
  string(%d) "test1"
}
Fetch Row using Nested cursor Query
array(1) {
  [0]=>
  string(%d) "test2"
}
Fetch Row using Nested cursor Query
array(1) {
  [0]=>
  string(%d) "test3"
}
Fetch Row using Nested cursor Query
array(1) {
  [0]=>
  string(%d) "test4"
}
Fetch Row using Nested cursor Query
array(1) {
  [0]=>
  string(%d) "test5"
}
Fetch Row using Nested cursor Query
array(1) {
  [0]=>
  string(%d) "test6"
}
Fetch Row using Nested cursor Query
array(1) {
  [0]=>
  string(%d) "test7"
}
Fetch Row using Nested cursor Query
array(1) {
  [0]=>
  string(%d) "test8"
}
Fetch Row using Nested cursor Query
array(1) {
  [0]=>
  string(%d) "test9"
}
Number of roundtrips made with prefetch count 5 for 10 rows is  3
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:09:23
  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:09:23
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- -----------------------------------------------
002- Test with Nested Cursors
003- -----------------------------------------------
004- Fetch Row using Nested cursor Query
005- array(1) {
006-   [0]=>
007-   string(%d) "test0"
008- }
009- Fetch Row using Nested cursor Query
010- array(1) {
011-   [0]=>
012-   string(%d) "test1"
013- }
014- Fetch Row using Nested cursor Query
015- array(1) {
016-   [0]=>
017-   string(%d) "test2"
018- }
019- Fetch Row using Nested cursor Query
020- array(1) {
021-   [0]=>
022-   string(%d) "test3"
023- }
024- Fetch Row using Nested cursor Query
025- array(1) {
026-   [0]=>
027-   string(%d) "test4"
028- }
029- Fetch Row using Nested cursor Query
030- array(1) {
031-   [0]=>
032-   string(%d) "test5"
033- }
034- Fetch Row using Nested cursor Query
035- array(1) {
036-   [0]=>
037-   string(%d) "test6"
038- }
039- Fetch Row using Nested cursor Query
040- array(1) {
041-   [0]=>
042-   string(%d) "test7"
043- }
044- Fetch Row using Nested cursor Query
045- array(1) {
046-   [0]=>
047-   string(%d) "test8"
048- }
049- Fetch Row using Nested cursor Query
050- array(1) {
051-   [0]=>
052-   string(%d) "test9"
053- }
054- Number of roundtrips made with prefetch count 5 for 10 rows is  3
055- Done

 

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

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