mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
bugfix: federated/replication did not increment bytes_received status variable
because mysql->net.thd was reset to NULL in mysql_real_connect() and thd_increment_bytes_received() didn't do anything. Fix: * set mysql->net.thd to current_thd instread. * remove the test for non-null THD from a very often used function thd_increment_bytes_received().
This commit is contained in:
@@ -369,16 +369,6 @@ void thd_close_connection(THD *thd)
|
||||
vio_close(thd->net.vio);
|
||||
}
|
||||
|
||||
/**
|
||||
Get current THD object from thread local data
|
||||
|
||||
@retval The THD object for the thread, NULL if not connection thread
|
||||
*/
|
||||
THD *thd_get_current_thd()
|
||||
{
|
||||
return current_thd;
|
||||
}
|
||||
|
||||
/**
|
||||
Lock data that needs protection in THD object
|
||||
|
||||
@@ -4074,16 +4064,12 @@ my_bool thd_net_is_killed()
|
||||
|
||||
void thd_increment_bytes_received(void *thd, ulong length)
|
||||
{
|
||||
if (unlikely(!thd)) // Called from federatedx
|
||||
thd= current_thd;
|
||||
((THD*) thd)->status_var.bytes_received+= length;
|
||||
}
|
||||
|
||||
|
||||
void thd_increment_net_big_packet_count(void *thd, ulong length)
|
||||
{
|
||||
if (unlikely(!thd)) // Called from federatedx
|
||||
thd= current_thd;
|
||||
((THD*) thd)->status_var.net_big_packet_count+= length;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user