summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-06-27 16:50:39 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2019-06-27 16:50:39 +0200
commit51c3a5c84023671903af2879c8f85f3dd1e8344d (patch)
tree3b25ec3f592fedd1875137dc9e8b346200a62f80
parentdc11aab9b38ab8c7ea95be6306fe09a1f4269288 (diff)
downloadmariadb-git-51c3a5c84023671903af2879c8f85f3dd1e8344d.tar.gz
MDEV-19893 Do not send error packets with seqno= 0
-rw-r--r--sql/protocol.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 8b7e0cbcbea..aa795b9d12a 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -461,6 +461,17 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
*/
if ((save_compress= net->compress))
net->compress= 2;
+
+ /*
+ Sometimes, we send errors "out-of-band", e.g ER_CONNECTION_KILLED
+ on an idle connection. The current protocol "sequence number" is 0,
+ however some client drivers would however always expect packets
+ 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;
+
ret= net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) buff,
length);
net->compress= save_compress;