Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
3.3, 3.4
-
None
-
None
Description
When using mysql_real_connect_start() / mysql_real_connect_cont(), the calling application will use mysql_get_socket() to establish which fd to register events for.
However, when errors occur, mysql_real_connect() can close the socket and potentially open a new one without informing the calling application, so that the calling application potentially has events registered on the wrong fd.
The attached patch (against v3.4) adds the ability to register a callback to run whenever the library opens or closes a socket, allowing the calling application to be notified of these events, so it can correctly amend its registered events.