No ORA-error message when OCI_NO_DATA

Bug #59985 No ORA-error message when OCI_NO_DATA
Submitted: 2011-10-03 07:22 UTC Modified: 2011-11-10 22:51 UTC
From: sss at rdw dot ru Assigned: sixd (profile)
Status: Closed Package: OCI8 related
PHP Version: 5.3.6 OS: linux
Private report: No CVE-ID: None

 [2011-10-03 07:22 UTC] sss at rdw dot ru

Description:
------------
When pl/sql trow exeption ORA-01403
php don't show this Warning message.




Reproduce code:
---------------
$x = '';
$conn = oci_connect("scott", "tiger", "mydb");

//ORA-01403 bad Warning message (no pl/sql trace)
$stid = oci_parse( $conn, 'Begin Select 1 Into :x From dual Where 1 = 2; End;' );
oci_bind_by_name($stid, ":x", $x);
oci_execute($stid);


//ORA-01476 good Warning message
$stid = oci_parse( $conn, 'Begin Select 1/0 Into :x From dual; End;' );
oci_bind_by_name($stid, ":x", $x);
oci_execute($stid);


Expected result:
----------------
Warning: oci_execute() [function.oci-execute]: ORA-01403: no data found ORA-06512: at line 1 in /www/docs/rdw/bootstrap.php on line 8

Warning: oci_execute() [function.oci-execute]: ORA-01476: divisor is equal to zero ORA-06512: at line 1 in /www/docs/rdw/bootstrap.php on line 13

Actual result:
--------------
Warning: oci_execute() [function.oci-execute]: OCI_NO_DATA in /www/docs/rdw/bootstrap.php on line 8

Warning: oci_execute() [function.oci-execute]: ORA-01476: divisor is equal to zero ORA-06512: at line 1 in /www/docs/rdw/bootstrap.php on line 13

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2011-11-09 23:49 UTC] sixd@php.net

-Package: oci8 +Package: OCI8 related

 [2011-11-10 22:51 UTC] sixd@php.net

-Status: Open +Status: Closed -Assigned To: +Assigned To: sixd

 [2011-11-10 22:51 UTC] sixd@php.net

The error stack was always available after calling oci_error($stid).

I've merged a change to OCI8 so the default warning now includes the error stack 
too.