#42134 [Opn->Fbk]: oci_error() returns false after oci_new_collection() fails
| From: | tony2001@php.net | Date: | Tue, 31 Jul 2007 07:20:23 +0000 |
| Subject: | #42134 [Opn->Fbk]: oci_error() returns false after oci_new_collection() fails | ||
| References: | 1 | Groups: | php.bugs php.bugs |
| Request: | Send a blank email to php-bugs+get-115619@lists.php.net to get a copy of this message | ||
ID: 42134
Updated by: tony2001@php.net
Reported By: sixd@php.net
-Status: Open
+Status: Feedback
Bug Type: OCI8 related
Operating System: n/a
PHP Version: 5CVS-2007-07-28 (CVS)
New Comment:
http://dev.daylessday.org/diff/bug42134.diff
try this patch plz.
Previous Comments:
------------------------------------------------------------------------
[2007-07-28 21:40:16] sixd@php.net
Description:
------------
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
zend_list_delete(collection->connection->rsrc_id)
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:
---------------
<?php
$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:
--------------
Error:
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42134&edit=1