From:             [EMAIL PROTECTED]
Operating system: n/a
PHP version:      5CVS-2007-07-28 (CVS)
PHP Bug Type:     OCI8 related
Bug description:  oci_error() returns false after oci_new_collection() fails

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 bug report at http://bugs.php.net/?id=42134&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42134&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42134&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42134&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42134&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42134&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42134&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42134&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42134&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42134&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42134&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42134&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42134&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42134&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42134&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42134&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42134&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42134&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42134&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42134&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42134&r=mysqlcfg

Reply via email to