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

Bug #16003 Incorrect check for error after mysqli_store_result
Submitted: 2009-03-09 23:46 UTC
From: gsoltis Assigned: quipo
Status: Closed Package: MDB2_Driver_mysqli (version 1.4.1)
PHP Version: 5.1.6 OS: Centos
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 32 - 8 = ?

 
 [2009-03-09 23:46 UTC] gsoltis (Greg Soltis)
Description: ------------ In the context of calling a stored procedure through executeStoredProc: The description for mysqli_store_result (http://us.php.net/manual/en/mysqli.store-result.php) specifies that a return value of 'FALSE' is not necessarily an error. It is possible that the query simply did not return a result set, for example, an INSERT-type query. MDB2_Driver_mysqli, in Driver/mysqli.php#603 assumes that false means an error has occurred. The API for mysqli_store_result indicates that on a return value of false, the error string should be checked to determine if an error has actually occurred. This can be accomplished by checking mysqli_error() or mysqli_errno() for a non-empty string or non-zero value, respectively. Test script: --------------- $result = $mdb->executeStoredProc('myProc', $someParams); Where myProc is a mysql stored procedure that performs an insert and does not return a result set. Expected result: ---------------- $result should be equal to FALSE without having an error raised. Actual result: -------------- MDB2->raiseError is called.

Comments

 [2009-03-10 01:52 UTC] gsoltis (Greg Soltis)
-PHP Version: 5.1.4 +PHP Version: 5.1.6
 [2009-03-29 22:04 UTC] quipo (Lorenzo Alberton)
-Status: Open +Status: Closed -Assigned To: +Assigned To: quipo
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.