ID: 39820 User updated by: alien at mosfasad dot ru Reported By: alien at mosfasad dot ru Status: Open Bug Type: PDO related Operating System: win xp PHP Version: 5.2.0 New Comment:
!!! WRONG !!! : /* !!! IF COMMENT LINE BELOW, NO ERROR */ $oPDOs->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); /**/ if i comment this lines error i can look error, when i call method errorInfo( )! print_r( $oStat->errorInfo( ) ); Previous Comments: ------------------------------------------------------------------------ [2006-12-25 12:12:48] alien at mosfasad dot ru $sSql = 'call ReportOrder(:var0,:out0,:var1,:var2,:var3)'; CREATE OR REPLACE PROCEDURE ReportOrder ( dFormId NUMBER, dCalcId OUT VARCHAR2, sUnionDescr VARCHAR2, sArgsName VARCHAR2, sColsName VARCHAR2 ) IS BEGIN dCalcId := '1'; END; ------------------------------------------------------------------------ [2006-12-25 11:21:54] [EMAIL PROTECTED] >If the script requires a database to demonstrate the issue, >please make sure it creates all necessary tables, stored >procedures etc. ------------------------------------------------------------------------ [2006-12-25 11:18:32] alien at mosfasad dot ru ini_set('display_errors','on'); $sSql = 'call wb_utils.ReportOrder(:var0,:out0,:var1,:var2,:var3)'; $sOut = ' '; $aArguments = Array ( 'var0' => 24277102, 'var1' => '', 'var2' => 'args', 'var3' => 'cols' ); $sDsn = 'oci:dbname=//saturn.icon3.ru/mito'; $sUser = 'XXX'; $sPass = 'XXXXXX'; $aArgs = array(); $oPDOs = new PDO($sDsn,$sUser,$sPass,$aArgs); /* !!! IF COMMENT LINE BELOW, NO ERROR */ $oPDOs->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); /**/ $oStat = $oPDOs->prepare( $sSql ); $oStat->bindParam('out0',$sOut, PDO::PARAM_STR,strlen( $sOut ) ); $oStat->execute($aArguments); echo '['.$sOut.']'; ------------------------------------------------------------------------ [2006-12-18 08:40:51] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2006-12-13 17:09:16] alien at mosfasad dot ru Description: ------------ when i execute procedure(ORACLE 10 R2) with out param. i catch error in the version 5.1.4 all is ok. Procedure wb_utils.ReportOrder is VALID ! PHP Version 5.2.1-dev PHP API 20041225 PHP Extension 20060613 Zend Extension 220060519 OCI Revision $Revision: 1.269.2.16.2.26 $ PDO Driver for OCI 8 and later: enabled Reproduce code: --------------- $sSql = 'call wb_utils.ReportOrder(:var0,:out0,:var1,:var2,:var3)'; $aArguments = Array ( [var0] => 24277102 [var1] => [var2] => args [var3] => cols ) $oStat = $this->oPDOs->prepare($sSql); ..... $oStat->bindParam('out0',$this->Out0, PDO::PARAM_STR,4096); ..... $oStat->execute($aArguments); Expected result: ---------------- [13-дек-2006 19:49:57] PHP Fatal error: Uncaught in C:\prj\web\include\db.2.inc.php at 410 code :pdo_execute Param [HY000,SQLSTATE[HY000]: General error: 3131 OCIStmtExecute: ORA-03131: an invalid buffer was provided for the next piece (ext\pdo_oci\oci_statement.c:142), call wb_utils.ReportOrder(:var0,:out0,:var1,:var2,:var3) ] thrown in C:\prj\web\include\db.2.inc.php on line 410 Actual result: -------------- execute procedure and get out param ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39820&edit=1