Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
Some library functions like mysql_library_init() or mysql_init() may fail and on error they do not return MYSQL* structure. To detect their error code and message it was possible to call mysql_errno(NULL) and mysql_error(NULL) to retrieve them. This is working fine since MySQL version 5.0.60 (for 5.0 series) and globally since 5.1.24 (for 5.1 and new series). But MariaDB 10.2 stopped using MySQL client implementation (where it worked fine) and started to use MariaDB Connector/C which does not provide meaningful value from mysql_errno(NULL) and mysql_error(NULL) calls. It always returns 0 and empty string. So when mysql_library_init() or mysql_init() fails, caller does not why. Since MariaDB 10.2 started using MariaDB Connector/C there is no way to retrieve error code or message for these functions. So please fix mysql_errno(NULL) and mysql_error(NULL) functions to return real error code/messages for last mysql_* function call.