summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-08-25 12:40:09 +0200
committerSergei Golubchik <serg@mariadb.org>2016-08-25 12:40:09 +0200
commit6b1863b8304662189a3b9a4aef1e1bebef035b86 (patch)
tree48ba2cbdda863b644108e93ace3668333ae0d193 /sql/protocol.cc
parentea91bb6801b1b619d64fa137ea351eca9de683ec (diff)
parent5bbe929d706e26cb3f9b291da6009526a17b1545 (diff)
downloadmariadb-git-6b1863b8304662189a3b9a4aef1e1bebef035b86.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index fa42915f5a9..4ae9497c039 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -373,7 +373,8 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
uint error;
char converted_err[MYSQL_ERRMSG_SIZE];
char buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos;
-
+ my_bool ret;
+ uint8 save_compress;
DBUG_ENTER("send_error_packet");
if (net->vio == 0)
@@ -401,8 +402,16 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
/* Converted error message is always null-terminated. */
length= (uint) (strmake(pos, converted_err, MYSQL_ERRMSG_SIZE - 1) - buff);
- DBUG_RETURN(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) buff,
- length));
+ /*
+ Ensure that errors are not compressed. This is to ensure we can
+ detect out of bands error messages in the client
+ */
+ if ((save_compress= net->compress))
+ net->compress= 2;
+ ret= net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) buff,
+ length);
+ net->compress= save_compress;
+ DBUG_RETURN(ret);
}
#endif /* EMBEDDED_LIBRARY */