Commit d2b39a2c authored by Monty's avatar Monty Committed by Sergei Golubchik

Reset some longlong global variables as part of FLUSH STATUS

Added SHOW_LONGLONG_NOFLUSH to mark the variables that should not be
flushed.

New variables cleared as part of SHOW STATUS:
- Rpl_semi_sync_master_request_ack
- Rpl_semi_sync_master_get_ac
- Rpl_semi_sync_slave_send_ack
- Slave_skipped_error
parent d7bc28e2
......@@ -7499,7 +7499,7 @@ SHOW_VAR status_vars[]= {
{"Max_used_connections", (char*) &max_used_connections, SHOW_LONG},
{"Max_used_connections_time",(char*) &show_max_used_connections_time, SHOW_SIMPLE_FUNC},
{"Memory_used", (char*) &show_memory_used, SHOW_SIMPLE_FUNC},
{"Memory_used_initial", (char*) &start_memory_used, SHOW_LONGLONG},
{"Memory_used_initial", (char*) &start_memory_used, SHOW_LONGLONG_NOFLUSH},
{"Resultset_metadata_skipped", (char *) offsetof(STATUS_VAR, skip_metadata_count),SHOW_LONG_STATUS},
{"Not_flushed_delayed_rows", (char*) &delayed_rows_in_use, SHOW_LONG_NOFLUSH},
{"Open_files", (char*) &my_file_opened, SHOW_SINT},
......@@ -7640,7 +7640,7 @@ SHOW_VAR status_vars[]= {
{"wsrep_connected", (char*) &wsrep_connected, SHOW_BOOL},
{"wsrep_ready", (char*) &wsrep_show_ready, SHOW_FUNC},
{"wsrep_cluster_state_uuid",(char*) &wsrep_cluster_state_uuid,SHOW_CHAR_PTR},
{"wsrep_cluster_conf_id", (char*) &wsrep_cluster_conf_id, SHOW_LONGLONG},
{"wsrep_cluster_conf_id", (char*) &wsrep_cluster_conf_id, SHOW_LONGLONG_NOFLUSH},
{"wsrep_cluster_status", (char*) &wsrep_cluster_status, SHOW_CHAR_PTR},
{"wsrep_cluster_size", (char*) &wsrep_cluster_size, SHOW_LONG_NOFLUSH},
{"wsrep_local_index", (char*) &wsrep_local_index, SHOW_LONG_NOFLUSH},
......
......@@ -23,7 +23,8 @@
*/
#define SHOW_always_last SHOW_KEY_CACHE_LONG, \
SHOW_HAVE, SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, \
SHOW_LONG_NOFLUSH, SHOW_LEX_STRING, SHOW_ATOMIC_COUNTER_UINT32_T, \
SHOW_LONG_NOFLUSH, SHOW_LONGLONG_NOFLUSH, SHOW_LEX_STRING, \
SHOW_ATOMIC_COUNTER_UINT32_T, \
/* SHOW_*_STATUS must be at the end, SHOW_LONG_STATUS being first */ \
SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, SHOW_LONGLONG_STATUS, \
SHOW_UINT32_STATUS
......
......@@ -3582,6 +3582,8 @@ void reset_status_vars()
/* Note that SHOW_LONG_NOFLUSH variables are not reset */
if (ptr->type == SHOW_LONG)
*(ulong*) ptr->value= 0;
if (ptr->type == SHOW_LONGLONG)
*(ulonglong*) ptr->value= 0;
}
}
......@@ -3780,6 +3782,7 @@ const char* get_one_variable(THD *thd,
case SHOW_SLONG:
end= int10_to_str(*value.as_long, buff, -10);
break;
case SHOW_LONGLONG_NOFLUSH: // the difference lies in refresh_status()
case SHOW_SLONGLONG:
end= longlong10_to_str(*value.as_longlong, buff, -10);
break;
......
......@@ -54,6 +54,7 @@ static inline SHOW_SCOPE show_scope_from_type(enum enum_mysql_show_type type)
case SHOW_UINT:
case SHOW_ULONG:
case SHOW_ULONGLONG:
case SHOW_LONGLONG_NOFLUSH:
return SHOW_SCOPE_GLOBAL;
case SHOW_DOUBLE_STATUS:
......@@ -734,6 +735,7 @@ bool PFS_status_variable_cache::can_aggregate(enum_mysql_show_type variable_type
case SHOW_DOUBLE_STATUS:
case SHOW_HA_ROWS:
case SHOW_LONG_NOFLUSH:
case SHOW_LONGLONG_NOFLUSH:
case SHOW_SLONG:
default:
return false;
......
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