You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: prepared statement binary reset/cleanup is incomplete on main #23977
Prepared-statement binary protocol state handling is incomplete on main:
COM_STMT_RESET / reset prepare acknowledges the reset but leaves COM_STMT_SEND_LONG_DATA accumulated state on the server-side PrepareStmt.
COM_STMT_CLOSE and COM_STMT_RESET continue past GetPrepareStmt failures and can dereference a nil PrepareStmt instead of returning a clean error response.
After binary parameter parsing, PrepareStmt.Close() can free params through an unset prepareStmt.proc, so deallocate / close / session cleanup paths are not safely wired to the binary-param allocation context.
Expected Behavior
COM_STMT_RESET should clear accumulated binary prepared-statement state from COM_STMT_SEND_LONG_DATA.
COM_STMT_CLOSE / COM_STMT_RESET should return an error response when the statement does not exist and should not dereference nil state.
Prepared-statement close/deallocate/session cleanup should always free binary parameter vectors through a valid process/mempool context.
Steps to Reproduce
Use a MySQL client that exposes binary prepared statements on main.
Prepare a statement with at least one parameter and send parameter payload via COM_STMT_SEND_LONG_DATA.
Issue COM_STMT_RESET or deallocate/close the statement.
Observe that reset does not clear the accumulated binary state, and close/reset error paths are not robust when the target statement is missing.
Activity