$php_errormsg is limited in size of characters

Bug #47281 $php_errormsg is limited in size of characters
Submitted: 2009-02-02 18:08 UTC Modified: 2010-02-03 20:35 UTC
From: jeffersongranatto at mannesoft dot com dot br Assigned: sixd (profile)
Status: Closed Package: OCI8 related
PHP Version: 5.3.1 OS: Linux
Private report: No CVE-ID: None

 [2009-02-02 18:08 UTC] jeffersongranatto at mannesoft dot com dot br

Description:
------------
Sometimes, I need to show a big error message on a trigger of Oracle. Oracle supports this type of situation, but $php_errormsg does not display more than 500 characters.

Reproduce code:
---------------
create procedure sp_test as
begin
  raise_application_error(-20000, 'more than 500 characters');
end;


$stmt = ociparse($conn, 'begin sp_test; end;');
ociexecute($stmt, OCI_DEFAULT);
echo $php_errormsg;


Expected result:
----------------
The full message.

Actual result:
--------------
The message truncated to 500 characters.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2009-12-27 17:03 UTC] jeffersongranatto at mannesoft dot com dot br

Solution:

In ext/oci8/oci8.c, change the value of the constant PHP_OCI_ERRBUF_LEN to 1024. It's the biggest message that Oracle can return.

 [2010-02-03 20:35 UTC] sixd@php.net

Fixed in PHP 5.3.2 and PECL OCI8 1.4.1