Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The current error handling in mx_mysql logs errors multiple times in different forms due to nested functions and the mapping of MySQL error codes to system error codes. This leads to unclear semantics and complicated code. The current error handling return the same error in errno and in the function return value which results in uneeded accesses to errno This commit introduces the following changes: * MySQL error strings are captured but not logged by the module. A new function mx_mysql_error() is provided for the caller to retrieve the latest error string. * System error codes are returned as the function value, but errno is not set. * It is now the caller's responsibility to log errors. This change reduces the object size of mx_mysql by 28%. Future commits will address error return values that do not relate to MySQL error strings.
- Loading branch information