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_get_5.phpt ('Oracle Database 12c Implicit Result Sets: oci_get_implicit_resultset: get from wrong statement')

Script

1: <?php
2:
3:
require(dirname(__FILE__).'/connect.inc');
4:
5: function 
print_row($row)
6: {
7:     foreach (
$row as $item) {
8:         echo 
"  ".$item;
9:     }
10:     echo 
"\n";
11: }
12:
13:
$plsql 
14:     
"declare
15:       c1 sys_refcursor;
16:     begin
17:       open c1 for select 1 from dual union all select 2 from dual;
18:       dbms_sql.return_result(c1);
19:       open c1 for select 3 from dual union all select 4 from dual;
20:       dbms_sql.return_result(c1);
21:       open c1 for select 5 from dual union all select 6 from dual;
22:       dbms_sql.return_result(c1);
23:     end;"
;
24:
25:
// Run Test
26:
27:
echo "Test 1\n";
28:
// This test effectively discards all the first IRS results
29:
$s oci_parse($c$plsql);
30:
oci_execute($s);
31: while ((
$s1 oci_get_implicit_resultset($s))) {  // $s1 is never used again so its results are lost
32:     
while (($row oci_fetch_array($sOCI_ASSOC+OCI_RETURN_NULLS)) != false) {  // use parent $s instead of $s1
33:         
print_row($row);
34:     }
35: }
36:
oci_free_statement($s);
37:
38: echo 
"\nTest 2 - fetch first IRS explicitly\n";
39:
$s oci_parse($c$plsql);
40:
oci_execute($s);
41:
$s1 oci_get_implicit_resultset($s);
42: while ((
$row oci_fetch_row($s1)) != false) {
43:     
print_row($row);
44: }
45: while ((
$row oci_fetch_row($s)) != false) {
46:     
print_row($row);
47: }
48:
oci_free_statement($s);
49:
50: echo 
"\nTest 3 - fetch part of IRS explicitly\n";
51:
$s oci_parse($c$plsql);
52:
oci_execute($s);
53:
$s1 oci_get_implicit_resultset($s);
54: while ((
$row oci_fetch_row($s1)) != false) {
55:     
print_row($row);
56: }
57:
$row oci_fetch_row($s);
58:
print_row($row);
59:
$s1 oci_get_implicit_resultset($s);
60: while ((
$row oci_fetch_row($s1)) != false) {
61:     
print_row($row);
62: }
63: while ((
$row oci_fetch_row($s)) != false) {
64:     
print_row($row);
65: }
66:
oci_free_statement($s);
67:
68: echo 
"\nTest 4 - skip IRSs\n";
69:
$s oci_parse($c$plsql);
70:
oci_execute($s);
71:
$s1 oci_get_implicit_resultset($s);
72:
$s1 oci_get_implicit_resultset($s);
73: while ((
$row oci_fetch_row($s)) != false) { // parent
74:     
print_row($row);
75: }
76:
oci_free_statement($s);
77:
78:
?>
79:
===DONE===
80:

Expected

Test 1
  3
  4
  5
  6

Test 2 - fetch first IRS explicitly
  1
  2
  3
  4
  5
  6

Test 3 - fetch part of IRS explicitly
  1
  2
  3
  5
  6
  4

Test 4 - skip IRSs
  5
  6
===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:47: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)))
001- Test 1
002-   3
003-   4
004-   5
005-   6
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:47: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
007- Test 2 - fetch first IRS explicitly
008-   1
009-   2
010-   3
011-   4
012-   5
013-   6
015- Test 3 - fetch part of IRS explicitly
016-   1
017-   2
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
018-   3
019-   5
020-   6
021-   4
022- 
023- Test 4 - skip IRSs
024-   5
025-   6
026- ===DONE===

 

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

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