MDEV-21252 ER_HOST_IS_BLOCKED returns packet sequence 1 instead of 0
Fix regression introduced in MDEV-19893 Some errors must be sent with seqno = 0, e.g those that are detected before server sends its first "welcome" packet (e.g too many connections) This was not taken into account originally in MDEV-19893 fix. We need to check sql_errno, before fixing sequence number, to see if the error we send is really an out-of-bound, e.g a KILL.
This commit is contained in:
parent
a38b937bf1
commit
a3267c11fa
@ -467,8 +467,12 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
|
||||
coming from server to have seq_no > 0, due to missing awareness
|
||||
of "out-of-band" operations. Make these clients happy.
|
||||
*/
|
||||
if (!net->pkt_nr)
|
||||
net->pkt_nr= 1;
|
||||
if (!net->pkt_nr &&
|
||||
(sql_errno == ER_CONNECTION_KILLED || sql_errno == ER_SERVER_SHUTDOWN ||
|
||||
sql_errno == ER_QUERY_INTERRUPTED))
|
||||
{
|
||||
net->pkt_nr= 1;
|
||||
}
|
||||
|
||||
ret= net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) buff,
|
||||
length);
|
||||
|
Loading…
x
Reference in New Issue
Block a user