diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-01-25 22:58:57 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-01-25 22:58:57 +0100 |
commit | f4faac4d6ad31acc96b9edf8c322f3031123dfe0 (patch) | |
tree | 8c7b112e3464149928db6b0bb7c7ddd9067f69c9 /sql/net_serv.cc | |
parent | 2ff65ba53190ad897fc41f546fc4a7bdc80d9054 (diff) | |
parent | 666b9663f94c2a4f39d331b28fabd09f2dc43bf2 (diff) | |
download | mariadb-git-f4faac4d6ad31acc96b9edf8c322f3031123dfe0.tar.gz |
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/net_serv.cc')
-rw-r--r-- | sql/net_serv.cc | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sql/net_serv.cc b/sql/net_serv.cc index b6da7933bb1..d81c89fe534 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -34,6 +34,7 @@ HFTODO this must be hidden if we don't want client capabilities in embedded library */ + #include <my_global.h> #include <mysql.h> #include <mysql_com.h> @@ -107,13 +108,12 @@ extern void query_cache_insert(void *thd, const char *packet, ulong length, unsigned pkt_nr); #endif // HAVE_QUERY_CACHE #define update_statistics(A) A -#else -#define update_statistics(A) -#endif - -#ifdef MYSQL_SERVER +extern my_bool thd_net_is_killed(); /* Additional instrumentation hooks for the server */ #include "mysql_com_server.h" +#else +#define update_statistics(A) +#define thd_net_is_killed() 0 #endif #define TEST_BLOCKING 8 @@ -876,6 +876,16 @@ my_real_read(NET *net, size_t *complen, DBUG_PRINT("info",("vio_read returned %ld errno: %d", (long) length, vio_errno(net->vio))); + + if (i== 0 && thd_net_is_killed()) + { + len= packet_error; + net->error= 0; + net->last_errno= ER_CONNECTION_KILLED; + MYSQL_SERVER_my_error(net->last_errno, MYF(0)); + goto end; + } + #if !defined(__WIN__) && defined(MYSQL_SERVER) /* We got an error that there was no data on the socket. We now set up |