Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
3.2.4
-
None
Description
Server side prepared results can cause crashes of the ODBC driver.
The problem is, that the destructor of `ServerPrepareResult::~ServerPrepareResult` calls the function `forceReleasePrepareStatement` link .
This functions defintion link can throw an exception, either when the connection is lost or when there are still pending results in the queue (Error code `CR_COMMANDS_OUT_OF_SYNC`). See `mysql_stmt_close` for reason, when and why the exception will be thrown.
Not handling the exception inside the destructor leads to a crash. A simple catch and ignore of the exception is possible in case of connection lost. But for the case, that `mysql_stmt_close` sets `CR_COMMANDS_OUT_OF_SYNC` as error, ignoring the exception will lead to a minor memory leak.
Unfortunately, I am currently not sure how the fix should look like. But there should be preventions for letting the destructor throw an exception.
edit: formatting