summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-07-02 17:46:22 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-07-02 17:46:22 +0300
commite82fe21e3ac3141c92b7c4fb2d1fc3c083d834e8 (patch)
tree3ecf4329b6a623165aa6cb392ae71998de50c89e /sql/protocol.cc
parent709f0510e32981c59d7353e55a564073939db770 (diff)
parent7f1e1309bbd54a7923cf33a37938a29171ca0993 (diff)
downloadmariadb-git-e82fe21e3ac3141c92b7c4fb2d1fc3c083d834e8.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 84ca4585a12..02c95a42695 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;