Description:
In network_mysqld_con_send_error_full the length of the sqlstate string, but
network_mysqld_proto_append_err_packet will assume that string to be always 5 characters
in length.
How to repeat:
n/a
Suggested fix:
Either pad the sqlstate with leading zero characters and note that in the return value of
network_mysqld_proto_append_err_packet or explicitely check for sqlstate being of the
right length and return an error if that is not satisfied.
Even better would be to change the function signatures to make use of GErrors to convey
error conditions back to the caller, that would also get rid of a number of critical
warnings in that area of the code.