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/bug37581.phpt ('Bug #37581 (oci_bind_array_by_name clobbers input array when using SQLT_AFC, AVC)')

Script

1: <?php
2:
3:
require dirname(__FILE__)."/connect.inc";
4:
5:
$p1 "create or replace package BUG37581_PKG as
6: type str_array is table of char(2) index by binary_integer;
7: procedure array_bind(in_str in str_array, out_str out string);
8: end BUG37581_PKG;"
;
9:
10:
$p2 "create or replace package body BUG37581_PKG as
11:   procedure array_bind(in_str in str_array, out_str out string) is
12:   begin
13:     for i in 1 .. in_str.count loop
14:       out_str := in_str(i);
15:     end loop;
16:   end array_bind;
17: end BUG37581_PKG;"
;
18:
19:
$s1 oci_parse($c$p1);
20:
$s2 oci_parse($c$p2);
21:
oci_execute($s1);
22:
oci_execute($s2);
23:
24:
25:
$stmt           oci_parse($c,'begin bug37581_pkg.array_bind(:in_arr, :out_str); end;');
26:
$strings        = array('A','B','C','D','E');
27:
28:
oci_bind_array_by_name($stmt,':in_arr',$strings,5,1,SQLT_AFC);
29:
oci_bind_by_name($stmt,':out_str',$result,10);
30:
31:
oci_execute($stmt);
32:
var_dump($strings);
33:
34:
oci_execute($stmt);
35:
var_dump($strings);
36:
37: echo 
"Done\n";
38:
?>
39:

Expected

array(5) {
  [0]=>
  string(1) "A"
  [1]=>
  string(1) "B"
  [2]=>
  string(1) "C"
  [3]=>
  string(1) "D"
  [4]=>
  string(1) "E"
}
array(5) {
  [0]=>
  string(1) "A"
  [1]=>
  string(1) "B"
  [2]=>
  string(1) "C"
  [3]=>
  string(1) "D"
  [4]=>
  string(1) "E"
}
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:01:08
  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:01:08
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- array(5) {
002-   [0]=>
003-   string(1) "A"
004-   [1]=>
005-   string(1) "B"
006-   [2]=>
007-   string(1) "C"
008-   [3]=>
009-   string(1) "D"
010-   [4]=>
011-   string(1) "E"
012- }
013- array(5) {
014-   [0]=>
015-   string(1) "A"
016-   [1]=>
017-   string(1) "B"
018-   [2]=>
019-   string(1) "C"
020-   [3]=>
021-   string(1) "D"
022-   [4]=>
023-   string(1) "E"
024- }
025- Done

 

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

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