|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42134 oci_error() returns false after oci_new_collection() fails
Submitted: 2007-07-28 21:40 UTC Modified: 2007-07-31 19:21 UTC
From: Assigned:
Status: Closed Package: OCI8 related
PHP Version: 5CVS-2007-07-28 (CVS) OS: n/a
Private report: No CVE-ID:
 [2007-07-28 21:40 UTC]
Collection creation errors are displayed if display_errors and
error_reporting are set appropriately, but a subsequent oci_error()
returns false, so error trapping won't display the problem.

After OCITypeByName() fails in php_oci_collection_create(),
php_oci_collection_close() is called.  The line
causes the subsequent oci_error() function line
  connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection);
to return a null pointer.

Reproduce code:
$c = oci_connect('hr', 'hrpwd', '//localhost/XE');

$collection = oci_new_collection($c, "BOGUS");
if (!$collection) {
    $m = oci_error($c);
    echo "Error: ", $m["message"];

Expected result:
  Error: OCI-22303: type ""."BOGUS" not found

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-31 07:20 UTC]
try this patch plz.
 [2007-07-31 19:21 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Fri Nov 27 19:01:31 2015 UTC