Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.12.3

Bug #5762 Empty getRow() result causes ocifreestatemet() error
Submitted: 2005-10-24 10:04 UTC
From: roehr at zilleon dot com Assigned: aharvey
Status: Closed Package: DB
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2005-10-24 10:04 UTC] roehr at zilleon dot com
Description: ------------ Hi, when running a query with getRow() that yields no results an error occurs with the OCI8 function ocifreestatement(). See below. Thanks and best regards, Torsten Roehr Test script: --------------- $result = $db->getRow('SELECT * FROM table WHERE 1 = 0'); Expected result: ---------------- No error. Actual result: -------------- ocifreestatement(): supplied argument is not a valid OCI8-Statement resource, File: ...\PEAR\DB\oci8.php, Line: 418 Change line 418 from: return @OCIFreeStatement($result); to: return ($result) ? OCIFreeStatement($result) : false;

Comments

 [2005-11-28 12:39 UTC] roehr at zilleon dot com
The same applies to mysql.php line 422 is: return @mysql_free_result($result); should be: return ($result) ? mysql_free_result($result) : false; Maybe other drivers are affected as well.
 [2005-12-11 14:07 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-12-11 16:14 UTC] roehr at zilleon dot com
IMHO silencing errors is not the best way because PHP will still trigger an error and it will end up on my error stack. This is what I want to avoid.
 [2007-01-11 08:33 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2007-01-11 12:43 UTC] roehr at zilleon dot com
I've upgraded to MDB2 meanwhile but it still wouldn't hurt to change: return @OCIFreeStatement($result); to: return ($result) ? OCIFreeStatement($result) : false; I had used PHP 4.3.10 and Oracle 9i. HTH. Regards, Torsten
 [2007-01-12 00:53 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2007-01-12 03:11 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!