diff options
Diffstat (limited to 'sql/net_serv.cc')
-rw-r--r-- | sql/net_serv.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 225b6d9542e..6d200f55655 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -106,7 +106,7 @@ extern uint test_flags; extern ulong bytes_sent, bytes_received, net_big_packet_count; #ifdef HAVE_QUERY_CACHE #define USE_QUERY_CACHE -extern void query_cache_insert(const char *packet, ulong length, +extern void query_cache_insert(void *thd, const char *packet, ulong length, unsigned pkt_nr); #endif // HAVE_QUERY_CACHE #define update_statistics(A) A @@ -125,7 +125,7 @@ static my_bool net_write_buff(NET *, const uchar *, ulong); /** Init with packet info. */ -my_bool my_net_init(NET *net, Vio* vio, uint my_flags) +my_bool my_net_init(NET *net, Vio *vio, void *thd, uint my_flags) { DBUG_ENTER("my_net_init"); DBUG_PRINT("enter", ("my_flags: %u", my_flags)); @@ -144,10 +144,11 @@ my_bool my_net_init(NET *net, Vio* vio, uint my_flags) net->where_b = net->remain_in_buf=0; net->net_skip_rest_factor= 0; net->last_errno=0; - net->unused= 0; net->thread_specific_malloc= MY_TEST(my_flags & MY_THREAD_SPECIFIC); + net->thd= 0; #ifdef MYSQL_SERVER net->extension= NULL; + net->thd= thd; #endif if (vio) @@ -604,7 +605,7 @@ net_real_write(NET *net,const uchar *packet, size_t len) DBUG_ENTER("net_real_write"); #if defined(MYSQL_SERVER) && defined(USE_QUERY_CACHE) - query_cache_insert((char*) packet, len, net->pkt_nr); + query_cache_insert(net->thd, (char*) packet, len, net->pkt_nr); #endif if (net->error == 2) @@ -708,7 +709,7 @@ net_real_write(NET *net,const uchar *packet, size_t len) break; } pos+=length; - update_statistics(thd_increment_bytes_sent(length)); + update_statistics(thd_increment_bytes_sent(net->thd, length)); } #ifndef __WIN__ end: @@ -781,7 +782,7 @@ static my_bool my_net_skip_rest(NET *net, uint32 remain, thr_alarm_t *alarmed, DBUG_PRINT("enter",("bytes_to_skip: %u", (uint) remain)); /* The following is good for debugging */ - update_statistics(thd_increment_net_big_packet_count(1)); + update_statistics(thd_increment_net_big_packet_count(net->thd, 1)); if (!thr_alarm_in_use(alarmed)) { @@ -797,7 +798,7 @@ static my_bool my_net_skip_rest(NET *net, uint32 remain, thr_alarm_t *alarmed, size_t length= MY_MIN(remain, net->max_packet); if (net_safe_read(net, net->buff, length, alarmed)) DBUG_RETURN(1); - update_statistics(thd_increment_bytes_received(length)); + update_statistics(thd_increment_bytes_received(net->thd, length)); remain -= (uint32) length; limit-= length; if (limit < 0) @@ -950,7 +951,7 @@ my_real_read(NET *net, size_t *complen, } remain -= (uint32) length; pos+= length; - update_statistics(thd_increment_bytes_received(length)); + update_statistics(thd_increment_bytes_received(net->thd, length)); } #ifdef DEBUG_DATA_PACKETS |