Actual binary data are send using COM_STMT_SEND_LONG_DATA when using server prepare.
Actual implementation has 2 issues :
- Stream data are stored in an internal buffer, not send directly to socket.
- There is no max_allowed_packet size check to return a good client error. (COM_STMT_RESET must be called prior to throwing exception)
This cause unneeded use of memory, leading to OOM error, if stream size is really important.