From: fsurleau at skyservices dot net Operating system: linux PHP version: 4.3.11 PHP Bug Type: OCI8 related Bug description: PHP hang on ociexecute with collections
Description: ------------ PHP Version 4.3.11 System Linux dev1 2.4.9-e.48smp #1 SMP Fri Jul 30 18:52:05 EDT 2004 i686 Build Date Apr 17 2005 16:44:16 Configure Command './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-zlib-dir=/usr/local' '--without-mysql' '--with-dom=/usr/local' '--with-dom-xslt' '--with-dom-exslt' '--with-expat-dir=/usr/local' '--enable-xslt' '--with-xslt-sablot' '--with-iconv-dir' '--with-zlib=/usr/local' '--with-oci8=/usr/local/oracle10g' '--disable-rpath' '--with-iconv' '--with-gd' '--enable-sigchild' Server API Apache 2.0 Handler Can't call an Oracle procedure returning collections with Oracle10g OCI8 lib. A simple call to TEST_VARCHAR works (the result is outvarchar = 'VARCHAR VALUE'), and the entire code works when using Oracle9i OCI8 lib. With Oracle10g, the result is a hang of the httpd process at ociexecute( $stmt ). Oracle code : ------------- CREATE OR REPLACE TYPE "COLLECTION_TYPE" AS TABLE OF VARCHAR2(255); / CREATE OR REPLACE PACKAGE TEST AS PROCEDURE TEST_COLLECTION( OUTPARAM OUT COLLECTION_TYPE ); PROCEDURE TEST_VARCHAR( OUTPARAM OUT VARCHAR2 ); END; / CREATE OR REPLACE PACKAGE BODY TEST AS PROCEDURE TEST_COLLECTION( OUTPARAM OUT COLLECTION_TYPE ) IS BEGIN OUTPARAM := COLLECTION_TYPE( 'FIRST VALUE', 'SECOND VALUE', 'THIRD VALUE' ); END; PROCEDURE TEST_VARCHAR( OUTPARAM OUT VARCHAR2 ) IS BEGIN OUTPARAM := 'VARCHAR VALUE'; END; END; / Reproduce code: --------------- <?php $cnx = ociplogon( USER_INTER, PASS_INTER, BD_INTER ); $sql = "BEGIN\nTEST.TEST_COLLECTION( :outparam );\nEND;"; $stmt = ociparse( $cnx, $sql ); $outparam = ocinewcollection( $cnx, "COLLECTION_TYPE" ); ocibindbyname( $stmt, ":outparam", &$outparam, -1, OCI_B_SQLT_NTY ); ociexecute( $stmt ); for( $i = 0; $i < $outparam->size(); $i++ ) { echo( "outparam[$i] = '" . $outparam->getelem( $i ) . "'<br>\n" ); } $sql = "BEGIN\nTEST.TEST_VARCHAR( :outvarchar );\nEND;"; $stmt = ociparse( $cnx, $sql ); $outvarchar = ''; ocibindbyname( $stmt, ":outvarchar", &$outvarchar, 300 ); ociexecute( $stmt ); echo( "outvarchar = '" . $outvarchar . "'<br>\n" ); ?> Expected result: ---------------- outparam[0] = 'FIRST VALUE' outparam[1] = 'SECOND VALUE' outparam[2] = 'THIRD VALUE' outvarchar = 'VARCHAR VALUE' Actual result: -------------- no result ! -- Edit bug report at http://bugs.php.net/?id=32741&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32741&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32741&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32741&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32741&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32741&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32741&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32741&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32741&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32741&r=support Expected behavior: http://bugs.php.net/fix.php?id=32741&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32741&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32741&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32741&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32741&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32741&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32741&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32741&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32741&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32741&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32741&r=mysqlcfg