Details
Description
If a COM_STMT_PREPARE does not succeed, it remains in memory and is not pruned. The result of this is excessive memory usage for clients with long-running connections that use prepared statements which fail.
This happens due to the fix to MXS-5302 which does not take into account the case where the prepared statement fails to generate an ID which implies that it doesn't need to be stored.