From:             christopher dot jones at oracle dot com
Operating system: n/a
PHP version:      5.2.5
PHP Bug Type:     OCI8 related
Bug description:  New collection creation can fail with OCI-22303

Description:
------------
In some circumstances oci_new_collection() can fail. The problem
was reported to me as occurring from at least PHP 5.1.2 onwards.

The cause appears to be lack of a describe-handle free in the
OCI8 extension; this is under investigation.

Reproduce code:
---------------
create or replace type ut_num_list_t as table of number;
create or replace procedure test_load( 
    p_list_1                    ut_num_list_t) 
as
begin 
    for i in 1..p_list_1.count()
    loop
        null; 
    end loop;
end; 
/ 
show errors 


<?php

    $dbh = oci_pconnect('hr', 'hrpwd', '//localhost/XE');

    for ($x = 0; $x < 100000; $x++)
    {
        //print "$x\n";

        $list = array();
        for ($i = 0; $i < mt_rand(0, 15); $i++)
        {
            $list[] = mt_rand(0, 30);
        }

        $sql = "
            begin
                test_load(
                    p_list_1 => :list_1);
            end;";

        $sth = oci_parse($dbh, $sql);

        $type = 'UT_NUM_LIST_T';
        $placeholder = ':list_1';

        if (!($var = oci_new_collection($dbh, $type)))
        {
                print "Failed new collection creation on $x\n";
        }

        foreach ($list as $list_item)
        {
            $var->append($list_item);
        }

        oci_bind_by_name($sth, $placeholder, $var, -1, OCI_B_NTY);

        try
        {
          oci_execute($sth);
          $var->free();
          oci_free_statement($sth);
        }
        catch (Exception $e)
        {
          print "Failed on $x\n";
          throw $e;
        }
    }

print "Completed $x\n";


oci_close($dbh);
?>


Expected result:
----------------
Completed 100000

Actual result:
--------------
Warning: oci_new_collection(): OCI-22303: type ""."UT_NUM_LIST_T" not
found in /home/cjones/public_html/t1.php on line 26
Failed new collection creation on 65464

-- 
Edit bug report at http://bugs.php.net/?id=44113&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=44113&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44113&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44113&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44113&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44113&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44113&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44113&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44113&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44113&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44113&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44113&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44113&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44113&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44113&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=44113&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=44113&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44113&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44113&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44113&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44113&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44113&r=mysqlcfg

Reply via email to