1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-30 11:22:14 +03:00
include/my_sys.h:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/ha_heap.cc:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/sql_class.h:
  Merge
This commit is contained in:
unknown
2004-09-13 18:12:44 +03:00
22 changed files with 504 additions and 271 deletions

View File

@@ -298,6 +298,7 @@ void THD::init(void)
bzero((char*) warn_count, sizeof(warn_count));
total_warn_count= 0;
update_charset();
bzero((char *) &status_var, sizeof(status_var));
}
@@ -388,6 +389,7 @@ THD::~THD()
/* Ensure that no one is using THD */
pthread_mutex_lock(&LOCK_delete);
pthread_mutex_unlock(&LOCK_delete);
add_to_status(&global_status_var, &status_var);
/* Close connection */
#ifndef EMBEDDED_LIBRARY
@@ -430,6 +432,27 @@ THD::~THD()
}
/*
Add to one status variable another status variable
NOTES
This function assumes that all variables are long/ulong.
If this assumption will change, then we have to explictely add
the other variables after the while loop
*/
void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var)
{
ulong *end= (ulong*) ((byte*) to_var + offsetof(STATUS_VAR,
last_system_status_var) +
sizeof(ulong));
ulong *to= (ulong*) to_var, *from= (ulong*) from_var;
while (to != end)
*(to++)+= *(from++);
}
void THD::awake(THD::killed_state state_to_set)
{
THD_CHECK_SENTRY(this);
@@ -1628,3 +1651,27 @@ void TMP_TABLE_PARAM::init()
group_parts= group_length= group_null_parts= 0;
quick_group= 1;
}
void thd_increment_bytes_sent(ulong length)
{
current_thd->status_var.bytes_sent+= length;
}
void thd_increment_bytes_received(ulong length)
{
current_thd->status_var.bytes_received+= length;
}
void thd_increment_net_big_packet_count(ulong length)
{
current_thd->status_var.net_big_packet_count+= length;
}
void THD::set_status_var_init()
{
bzero((char*) &status_var, sizeof(status_var));
}