Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.5.2
-
Fix Version/s: 1.9.2
-
Component/s: Zend_Db, Zend_Db_Adapter_Mysqli
-
Labels:None
-
Fix Version Priority:Nice to Have
Description
Correct me if I'm wrong but I found no possible way to catch MySQL error codes when using Zend_Db_Adapter_Mysqli.
All exceptions are thrown without attaching error code.
Affected methods inside Zend_Db_Statement_Mysqli are:
public function _prepare()
public function _execute()
An easy/dirty fix would be replacing:
throw new Zend_Db_Statement_Mysqli_Exception("Mysqli prepare error: " . $mysqli->error);
...
with:
throw new Zend_Db_Statement_Mysqli_Exception("Mysqli prepare error: " . $mysqli->error, $mysqli->errno);
...
Attachments
Issue Links
| This issue is related to: | ||||
| ZF-3684 | Exception error codes are NULL in Zend_Db |
|
|
|
Patch which adds a second parameter to Zend_Db_Statement_Mysqli_Exception to track error number as well as error message