diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2022-01-11 17:46:51 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2022-01-11 17:46:51 +0100 |
commit | a3267c11fa6dfd950f8da0266b8afe8691809e82 (patch) | |
tree | 65f14e5df18dcb4cd1a4df67b3b66575e08ea01f /sql | |
parent | a38b937bf12ab7e39eeda6e6d4da1b426302dc70 (diff) | |
download | mariadb-git-a3267c11fa6dfd950f8da0266b8afe8691809e82.tar.gz |
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.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/protocol.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc index 613668b39a5..3da5d686d1a 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -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); |