Commit 71aa571d authored by unknown's avatar unknown

Bug#28149 overflow in some "SHOW STATUS"-variables

changed bytes_received, bytes_sent status variables to longlong


sql/mysqld.cc:
  changed bytes_received, bytes_sent status variables to longlong
sql/sql_class.h:
  changed bytes_received, bytes_sent status variables to longlong
sql/sql_show.cc:
  changed bytes_received, bytes_sent status variables to longlong
sql/structs.h:
  changed bytes_received, bytes_sent status variables to longlong
parent ce4e9f75
...@@ -6190,8 +6190,8 @@ struct show_var_st status_vars[]= { ...@@ -6190,8 +6190,8 @@ struct show_var_st status_vars[]= {
{"Aborted_connects", (char*) &aborted_connects, SHOW_LONG}, {"Aborted_connects", (char*) &aborted_connects, SHOW_LONG},
{"Binlog_cache_disk_use", (char*) &binlog_cache_disk_use, SHOW_LONG}, {"Binlog_cache_disk_use", (char*) &binlog_cache_disk_use, SHOW_LONG},
{"Binlog_cache_use", (char*) &binlog_cache_use, SHOW_LONG}, {"Binlog_cache_use", (char*) &binlog_cache_use, SHOW_LONG},
{"Bytes_received", (char*) offsetof(STATUS_VAR, bytes_received), SHOW_LONG_STATUS}, {"Bytes_received", (char*) offsetof(STATUS_VAR, bytes_received), SHOW_LONGLONG_STATUS},
{"Bytes_sent", (char*) offsetof(STATUS_VAR, bytes_sent), SHOW_LONG_STATUS}, {"Bytes_sent", (char*) offsetof(STATUS_VAR, bytes_sent), SHOW_LONGLONG_STATUS},
{"Com_admin_commands", (char*) offsetof(STATUS_VAR, com_other), SHOW_LONG_STATUS}, {"Com_admin_commands", (char*) offsetof(STATUS_VAR, com_other), SHOW_LONG_STATUS},
{"Com_alter_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_DB]), SHOW_LONG_STATUS}, {"Com_alter_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_DB]), SHOW_LONG_STATUS},
{"Com_alter_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_TABLE]), SHOW_LONG_STATUS}, {"Com_alter_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_ALTER_TABLE]), SHOW_LONG_STATUS},
......
...@@ -606,8 +606,8 @@ struct system_variables ...@@ -606,8 +606,8 @@ struct system_variables
typedef struct system_status_var typedef struct system_status_var
{ {
ulong bytes_received; ulonglong bytes_received;
ulong bytes_sent; ulonglong bytes_sent;
ulong com_other; ulong com_other;
ulong com_stat[(uint) SQLCOM_END]; ulong com_stat[(uint) SQLCOM_END];
ulong created_tmp_disk_tables; ulong created_tmp_disk_tables;
......
...@@ -1463,6 +1463,8 @@ static bool show_status_array(THD *thd, const char *wild, ...@@ -1463,6 +1463,8 @@ static bool show_status_array(THD *thd, const char *wild,
case SHOW_LONG_CONST: case SHOW_LONG_CONST:
end= int10_to_str(*(long*) value, buff, 10); end= int10_to_str(*(long*) value, buff, 10);
break; break;
case SHOW_LONGLONG_STATUS:
value= ((char *) status_var + (ulonglong) value);
case SHOW_LONGLONG: case SHOW_LONGLONG:
end= longlong10_to_str(*(longlong*) value, buff, 10); end= longlong10_to_str(*(longlong*) value, buff, 10);
break; break;
......
...@@ -190,7 +190,8 @@ enum SHOW_TYPE ...@@ -190,7 +190,8 @@ enum SHOW_TYPE
SHOW_NET_COMPRESSION, SHOW_NET_COMPRESSION,
SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING, SHOW_SLAVE_RETRIED_TRANS, SHOW_RPL_STATUS, SHOW_SLAVE_RUNNING, SHOW_SLAVE_RETRIED_TRANS,
SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_CONST_LONG, SHOW_KEY_CACHE_LONGLONG, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_CONST_LONG, SHOW_KEY_CACHE_LONGLONG,
SHOW_LONG_STATUS, SHOW_LONG_CONST_STATUS, SHOW_SLAVE_SKIP_ERRORS SHOW_LONG_STATUS, SHOW_LONG_CONST_STATUS, SHOW_SLAVE_SKIP_ERRORS,
SHOW_LONGLONG_STATUS
}; };
enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED}; enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment