php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
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

Add a Patch

Pull Requests

Add a Pull Request

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.
 [2009-12-29 14:47 UTC] johannes@php.net
Chris, please check this.
 [2010-01-05 04:43 UTC] sixd@php.net
Confirmed.
 [2010-01-07 23:59 UTC] svn@php.net
Automatic comment from SVN on behalf of sixd
Revision: http://svn.php.net/viewvc/?view=revision&revision=293235
Log: Bug #47281 ( is limited in size of characters).  Also remove redundant code line.
 [2010-02-03 20:08 UTC] svn@php.net
Automatic comment from SVN on behalf of pajoye
Revision: http://svn.php.net/viewvc/?view=revision&revision=294447
Log: Bug #47281 ( is limited in size of characters). Also remove redundant code line
 [2010-02-03 20:35 UTC] sixd@php.net
Fixed in PHP 5.3.2 and PECL OCI8 1.4.1
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 08:01:29 2024 UTC