Edit report at http://pear.php.net/bugs/bug.php?id=16003&edit=1
ID: 16003
Updated by: [email protected]
Reported By: greg dot soltis at webloyalty dot com
Summary: Incorrect check for error after mysqli_store_result
-Status: Open
+Status: Closed
Type: Bug
Package: MDB2_Driver_mysqli
Operating System: Centos
Package Version: 1.4.1
PHP Version: 5.1.6
-Assigned To:
+Assigned To: quipo
Roadmap Versions:
New Comment:
-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.
Previous Comments:
------------------------------------------------------------------------
[2009-03-09 21:52:27] gsoltis
-PHP Version: 5.1.4
+PHP Version: 5.1.6
------------------------------------------------------------------------
[2009-03-09 19:46:10] gsoltis
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.
------------------------------------------------------------------------