Commit 37f87d73 authored by Sergei Golubchik's avatar Sergei Golubchik

updated sys_vars.cc (converting 5.3 mysqld.cc and set_var.cc

changes appropriately)
parent 65ca700d
...@@ -118,6 +118,7 @@ KEY_CACHE *create_key_cache(const char *name, uint length) ...@@ -118,6 +118,7 @@ KEY_CACHE *create_key_cache(const char *name, uint length)
key_cache->param_block_size= dflt_key_cache_var.param_block_size; key_cache->param_block_size= dflt_key_cache_var.param_block_size;
key_cache->param_division_limit= dflt_key_cache_var.param_division_limit; key_cache->param_division_limit= dflt_key_cache_var.param_division_limit;
key_cache->param_age_threshold= dflt_key_cache_var.param_age_threshold; key_cache->param_age_threshold= dflt_key_cache_var.param_age_threshold;
key_cache->param_partitions= dflt_key_cache_var.param_partitions;
} }
} }
DBUG_RETURN(key_cache); DBUG_RETURN(key_cache);
......
...@@ -19,31 +19,6 @@ ...@@ -19,31 +19,6 @@
#define LOG_SLOW_VERBOSITY_INNODB 1 << 0 #define LOG_SLOW_VERBOSITY_INNODB 1 << 0
#define LOG_SLOW_VERBOSITY_QUERY_PLAN 1 << 1 #define LOG_SLOW_VERBOSITY_QUERY_PLAN 1 << 1
#ifdef DEFINE_VARIABLES_LOG_SLOW
/* Names here must be in same order as the bit's above */
static const char *log_slow_verbosity_names[]=
{
"innodb","query_plan",
NullS
};
static const unsigned int log_slow_verbosity_names_len[]=
{
sizeof("innodb") -1,
sizeof("query_plan")-1
};
TYPELIB log_slow_verbosity_typelib=
{ array_elements(log_slow_verbosity_names)-1,"", log_slow_verbosity_names,
(unsigned int *) log_slow_verbosity_names_len };
#else
extern TYPELIB log_slow_verbosity_typelib;
#endif /* DEFINE_VARIABLES_LOG_SLOW */
/* Defines for what kind of query plan was used and what to log */
/* /*
We init the used query plan with a bit that is alwyas set and all 'no' bits We init the used query plan with a bit that is alwyas set and all 'no' bits
to enable easy testing of what to log in sql_log.cc to enable easy testing of what to log in sql_log.cc
...@@ -63,45 +38,5 @@ extern TYPELIB log_slow_verbosity_typelib; ...@@ -63,45 +38,5 @@ extern TYPELIB log_slow_verbosity_typelib;
#define QPLAN_MAX ((ulong) 1) << 31 /* reserved as placeholder */ #define QPLAN_MAX ((ulong) 1) << 31 /* reserved as placeholder */
#define QPLAN_ALWAYS_SET QPLAN_MAX #define QPLAN_ALWAYS_SET QPLAN_MAX
#define QPLAN_VISIBLE_MASK (~(QPLAN_ALWAYS_SET)) #define QPLAN_VISIBLE_MASK (~(QPLAN_ALWAYS_SET))
#warning simplify
#ifdef DEFINE_VARIABLES_LOG_SLOW
/* Names here must be in same order as the bit's above */
static const char *log_slow_filter_names[]=
{
"admin",
"filesort",
"filesort_on_disk",
"full_join",
"full_scan",
"query_cache",
"query_cache_miss",
"tmp_table",
"tmp_table_on_disk",
NullS
};
static const unsigned int log_slow_filter_names_len[]=
{
sizeof("admin")-1,
sizeof("filesort")-1,
sizeof("filesort_on_disk")-1,
sizeof("full_join")-1,
sizeof("full_scan")-1,
sizeof("query_cache")-1,
sizeof("query_cache_miss")-1,
sizeof("tmp_table")-1,
sizeof("tmp_table_on_disk")-1
};
TYPELIB log_slow_filter_typelib=
{ array_elements(log_slow_filter_names)-1,"", log_slow_filter_names,
(unsigned int *) log_slow_filter_names_len };
#else
extern TYPELIB log_slow_filter_typelib;
#endif /* DEFINE_VARIABLES_LOG_SLOW */
static inline ulong fix_log_slow_filter(ulong org_filter)
{
return org_filter ? org_filter : QPLAN_ALWAYS_SET;
}
...@@ -52,8 +52,6 @@ ...@@ -52,8 +52,6 @@
#include "des_key_file.h" // load_des_key_file #include "des_key_file.h" // load_des_key_file
#include "sql_manager.h" // stop_handle_manager, start_handle_manager #include "sql_manager.h" // stop_handle_manager, start_handle_manager
#define DEFINE_VARIABLES_LOG_SLOW // Declare variables in log_slow.h
#include <m_ctype.h> #include <m_ctype.h>
#include <my_dir.h> #include <my_dir.h>
#include <my_bit.h> #include <my_bit.h>
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
and include a file with the prototype instead. and include a file with the prototype instead.
*/ */
extern void close_thread_tables(THD *thd); extern void close_thread_tables(THD *thd);
#warning remove that
/* /*
The rule for this file: everything should be 'static'. When a sys_var The rule for this file: everything should be 'static'. When a sys_var
...@@ -606,6 +607,9 @@ export bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type) ...@@ -606,6 +607,9 @@ export bool fix_delay_key_write(sys_var *self, THD *thd, enum_var_type type)
ha_open_options|= HA_OPEN_DELAY_KEY_WRITE; ha_open_options|= HA_OPEN_DELAY_KEY_WRITE;
break; break;
} }
#ifdef WITH_ARIA_STORAGE_ENGINE
maria_delay_key_write= myisam_delay_key_write;
#endif
return false; return false;
} }
static const char *delay_key_write_names[]= { "OFF", "ON", "ALL", NullS }; static const char *delay_key_write_names[]= { "OFF", "ON", "ALL", NullS };
...@@ -843,7 +847,7 @@ static Sys_var_keycache Sys_key_cache_block_size( ...@@ -843,7 +847,7 @@ static Sys_var_keycache Sys_key_cache_block_size(
CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_BLOCK_SIZE), CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_BLOCK_SIZE),
VALID_RANGE(512, 1024*16), DEFAULT(KEY_CACHE_BLOCK_SIZE), VALID_RANGE(512, 1024*16), DEFAULT(KEY_CACHE_BLOCK_SIZE),
BLOCK_SIZE(512), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), BLOCK_SIZE(512), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
ON_UPDATE(update_keycache_param)); ON_UPDATE(resize_keycache));
static Sys_var_keycache Sys_key_cache_division_limit( static Sys_var_keycache Sys_key_cache_division_limit(
"key_cache_division_limit", "key_cache_division_limit",
...@@ -852,7 +856,7 @@ static Sys_var_keycache Sys_key_cache_division_limit( ...@@ -852,7 +856,7 @@ static Sys_var_keycache Sys_key_cache_division_limit(
CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_DIVISION_LIMIT), CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_DIVISION_LIMIT),
VALID_RANGE(1, 100), DEFAULT(100), VALID_RANGE(1, 100), DEFAULT(100),
BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
ON_UPDATE(update_keycache_param)); ON_UPDATE(change_keycache_param));
static Sys_var_keycache Sys_key_cache_age_threshold( static Sys_var_keycache Sys_key_cache_age_threshold(
"key_cache_age_threshold", "This characterizes the number of " "key_cache_age_threshold", "This characterizes the number of "
...@@ -864,7 +868,7 @@ static Sys_var_keycache Sys_key_cache_age_threshold( ...@@ -864,7 +868,7 @@ static Sys_var_keycache Sys_key_cache_age_threshold(
CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_AGE_THRESHOLD), CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_AGE_THRESHOLD),
VALID_RANGE(100, ULONG_MAX), DEFAULT(300), VALID_RANGE(100, ULONG_MAX), DEFAULT(300),
BLOCK_SIZE(100), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), BLOCK_SIZE(100), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
ON_UPDATE(update_keycache_param)); ON_UPDATE(change_keycache_param));
static Sys_var_mybool Sys_large_files_support( static Sys_var_mybool Sys_large_files_support(
"large_files_support", "large_files_support",
...@@ -1060,7 +1064,7 @@ static Sys_var_ulong Sys_max_binlog_size( ...@@ -1060,7 +1064,7 @@ static Sys_var_ulong Sys_max_binlog_size(
static bool fix_max_connections(sys_var *self, THD *thd, enum_var_type type) static bool fix_max_connections(sys_var *self, THD *thd, enum_var_type type)
{ {
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
resize_thr_alarm(max_connections + resize_thr_alarm(max_connections + extra_max_connections +
global_system_variables.max_insert_delayed_threads + 10); global_system_variables.max_insert_delayed_threads + 10);
#endif #endif
return false; return false;
...@@ -1680,13 +1684,19 @@ static Sys_var_ulong Sys_trans_prealloc_size( ...@@ -1680,13 +1684,19 @@ static Sys_var_ulong Sys_trans_prealloc_size(
static const char *thread_handling_names[]= static const char *thread_handling_names[]=
{ {
"one-thread-per-connection", "no-threads", "loaded-dynamically", "one-thread-per-connection", "no-threads",
#if HAVE_POOL_OF_THREADS == 1
"pool-of-threads",
#endif
0 0
}; };
static Sys_var_enum Sys_thread_handling( static Sys_var_enum Sys_thread_handling(
"thread_handling", "thread_handling",
"Define threads usage for handling queries, one of " "Define threads usage for handling queries, one of "
"one-thread-per-connection, no-threads, loaded-dynamically" "one-thread-per-connection, no-threads, "
#if HAVE_POOL_OF_THREADS == 1
"pool-of-threads"
#endif
, READ_ONLY GLOBAL_VAR(thread_handling), CMD_LINE(REQUIRED_ARG), , READ_ONLY GLOBAL_VAR(thread_handling), CMD_LINE(REQUIRED_ARG),
thread_handling_names, DEFAULT(0)); thread_handling_names, DEFAULT(0));
...@@ -3124,137 +3134,127 @@ static Sys_var_enum Sys_plugin_maturity( ...@@ -3124,137 +3134,127 @@ static Sys_var_enum Sys_plugin_maturity(
READ_ONLY GLOBAL_VAR(server_maturity), CMD_LINE(REQUIRED_ARG), READ_ONLY GLOBAL_VAR(server_maturity), CMD_LINE(REQUIRED_ARG),
plugin_maturity_names, DEFAULT(MariaDB_PLUGIN_MATURITY_UNKNOWN)); plugin_maturity_names, DEFAULT(MariaDB_PLUGIN_MATURITY_UNKNOWN));
#error *may be* turn the below into sysvars static Sys_var_ulong Sys_deadlock_search_depth_short(
"deadlock_search_depth_short",
{"deadlock-search-depth-short", OPT_DEADLOCK_SEARCH_DEPTH_SHORT, "Short search depth for the two-step deadlock detection",
"Short search depth for the two-step deadlock detection", SESSION_VAR(wt_deadlock_search_depth_short), CMD_LINE(REQUIRED_ARG),
&global_system_variables.wt_deadlock_search_depth_short, VALID_RANGE(0, 32), DEFAULT(4), BLOCK_SIZE(1));
&max_system_variables.wt_deadlock_search_depth_short,
0, GET_ULONG, REQUIRED_ARG, 4, 0, 32, 0, 0, 0}, static Sys_var_ulong Sys_deadlock_search_depth_long(
{"deadlock-search-depth-long", OPT_DEADLOCK_SEARCH_DEPTH_LONG, "deadlock_search_depth_long",
"Long search depth for the two-step deadlock detection", "Long search depth for the two-step deadlock detection",
&global_system_variables.wt_deadlock_search_depth_long, SESSION_VAR(wt_deadlock_search_depth_long), CMD_LINE(REQUIRED_ARG),
&max_system_variables.wt_deadlock_search_depth_long, VALID_RANGE(0, 33), DEFAULT(15), BLOCK_SIZE(1));
0, GET_ULONG, REQUIRED_ARG, 15, 0, 33, 0, 0, 0},
{"deadlock-timeout-short", OPT_DEADLOCK_TIMEOUT_SHORT, static Sys_var_ulong Sys_deadlock_timeout_depth_short(
"Short timeout for the two-step deadlock detection (in microseconds)", "deadlock_timeout_short",
&global_system_variables.wt_timeout_short, "Short timeout for the two-step deadlock detection (in microseconds)",
&max_system_variables.wt_timeout_short, SESSION_VAR(wt_timeout_short), CMD_LINE(REQUIRED_ARG),
0, GET_ULONG, REQUIRED_ARG, 10000, 0, ULONG_MAX, 0, 0, 0}, VALID_RANGE(0, ULONG_MAX), DEFAULT(10000), BLOCK_SIZE(1));
{"deadlock-timeout-long", OPT_DEADLOCK_TIMEOUT_LONG,
"Long timeout for the two-step deadlock detection (in microseconds)", static Sys_var_ulong Sys_deadlock_timeout_depth_long(
&global_system_variables.wt_timeout_long, "deadlock_timeout_long",
&max_system_variables.wt_timeout_long, "Long timeout for the two-step deadlock detection (in microseconds)",
0, GET_ULONG, REQUIRED_ARG, 50000000, 0, ULONG_MAX, 0, 0, 0}, SESSION_VAR(wt_timeout_long), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, ULONG_MAX), DEFAULT(50000000), BLOCK_SIZE(1));
{"debug-crc-break", OPT_DEBUG_CRC,
"Call my_debug_put_break_here() if crc matches this number (for debug).",
&my_crc_dbug_check, &my_crc_dbug_check,
0, GET_ULONG, REQUIRED_ARG, 0, 0, ~(ulong) 0L, 0, 0, 0},
{"extra-port", OPT_EXTRA_PORT,
"Extra port number to use for tcp-connections in a one-thread-per-connection manner. 0 means don't use another port",
&mysqld_extra_port,
&mysqld_extra_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"extra-max-connections", OPT_MAX_CONNECTIONS,
"The number of connections on 'extra-port.",
&extra_max_connections,
&extra_max_connections, 0, GET_ULONG, REQUIRED_ARG, 1, 1, 100000,
0, 1, 0},
#ifdef SAFE_MUTEX #ifndef DBUG_OFF
{"mutex-deadlock-detector", OPT_MUTEX_DEADLOCK_DETECTOR, static Sys_var_ulong Sys_debug_crc_break(
"Enable checking of wrong mutex usage.", "debug_crc_break",
&safe_mutex_deadlock_detector, "Call my_debug_put_break_here() if crc matches this number (for debug)",
&safe_mutex_deadlock_detector, GLOBAL_VAR(my_crc_dbug_check), CMD_LINE(REQUIRED_ARG),
0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1));
#endif #endif
{"safemalloc-mem-limit", OPT_SAFEMALLOC_MEM_LIMIT, static Sys_var_uint Sys_extra_port(
"Simulate memory shortage when compiled with the --with-debug=full option.", "extra_port",
0, 0, 0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, "Extra port number to use for tcp connections in a "
"one-thread-per-connection manner. 0 means don't use another port",
READ_ONLY GLOBAL_VAR(mysqld_extra_port), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, UINT_MAX32), DEFAULT(0), BLOCK_SIZE(1));
#warning generalize that
#ifndef DBUG_OFF static Sys_var_ulong Sys_extra_max_connections(
#ifdef SAFEMALLOC "extra_max_connections", "The number of connections on extra-port",
{"skip-safemalloc", OPT_SKIP_SAFEMALLOC, GLOBAL_VAR(extra_max_connections), CMD_LINE(REQUIRED_ARG),
"Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG, VALID_RANGE(1, 100000), DEFAULT(1), BLOCK_SIZE(1), NO_MUTEX_GUARD,
0, 0, 0, 0, 0, 0}, sf_malloc_quick=1; NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(fix_max_connections));
#endif
#ifdef SAFE_MUTEX
static Sys_var_mybool Sys_mutex_deadlock_detector(
"mutex_deadlock_detector", "Enable checking of wrong mutex usage",
READ_ONLY GLOBAL_VAR(safe_mutex_deadlock_detector),
CMD_LINE(OPT_ARG), DEFAULT(TRUE));
#endif #endif
{"log-slow-time", OPT_LONG_QUERY_TIME, static Sys_var_keycache Sys_key_cache_segments(
"Log all queries that have taken more than long_query_time seconds to execute to file. " "key_cache_segments", "The number of segments in a key cache",
"The argument will be treated as a decimal value with microsecond precission.", KEYCACHE_VAR(param_partitions),
&long_query_time, &long_query_time, 0, GET_DOUBLE, CMD_LINE(REQUIRED_ARG, OPT_KEY_CACHE_PARTITIONS),
REQUIRED_ARG, 10, 0, LONG_TIMEOUT, 0, 0, 0}, VALID_RANGE(0, MAX_KEY_CACHE_PARTITIONS),
{"key_cache_segments", OPT_KEY_CACHE_PARTITIONS, DEFAULT(DEFAULT_KEY_CACHE_PARTITIONS),
"The number of segments in a key cache", BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
&dflt_key_cache_var.param_partitions, 0, ON_UPDATE(repartition_keycache));
0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG, DEFAULT_KEY_CACHE_PARTITIONS,
0, MAX_KEY_CACHE_PARTITIONS, 0, 1, 0}, static const char *log_slow_filter_names[]=
{"log-slow-filter", OPT_LOG_SLOW_FILTER, { "admin", "filesort", "filesort_on_disk", "full_join", "full_scan",
"Log only the queries that followed certain execution plan. Multiple flags " "query_cache", "query_cache_miss", "tmp_table", "tmp_table_on_disk", 0
"allowed in a comma-separated string. [admin, filesort, filesort_on_disk, " };
"full_join, full_scan, query_cache, query_cache_miss, tmp_table, " static Sys_var_set Sys_log_slow_filter(
"tmp_table_on_disk]. Sets log-slow-admin-command to ON", "log_slow_filter",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, QPLAN_ALWAYS_SET, 0, 0}, "Log only certain types of queries. Multiple "
{"log-slow-rate_limit", OPT_LOG_SLOW_RATE_LIMIT, "flags can be specified, separated by commas. Valid values are admin, "
"If set, only write to slow log every 'log_slow_rate_limit' query (use " "slave, filesort, filesort_on_disk, full_join, full_scan, query_cache, "
"this to reduce output on slow query log)", "query_cache_miss, tmp_table, tmp_table_on_disk",
&global_system_variables.log_slow_rate_limit, SESSION_VAR(log_slow_filter), CMD_LINE(REQUIRED_ARG),
&max_system_variables.log_slow_rate_limit, 0, GET_ULONG, log_slow_filter_names, DEFAULT(QPLAN_ALWAYS_SET));
REQUIRED_ARG, 1, 1, ~0L, 0, 1L, 0}, #warning fix log-slow-slave-statements and log-slow-admin-statements
{"log-slow-verbosity", OPT_LOG_SLOW_VERBOSITY,
"Choose how verbose the messages to your slow log will be. Multiple flags " static Sys_var_ulong Sys_log_slow_rate_limit(
"allowed in a comma-separated string. [query_plan, innodb]", "log_slow_rate_limit",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, "Write to slow log every #th slow query. Set to 1 to log everything. "
global_system_variables.log_slow_verbosity= LOG_SLOW_VERBOSITY_INIT; "Increase it to reduce the size of the slow or the performance impact "
global_system_variables.log_slow_filter= QPLAN_ALWAYS_SET; "of slow logging",
{"log-slow-file", OPT_SLOW_QUERY_LOG_FILE, SESSION_VAR(log_slow_rate_limit), CMD_LINE(REQUIRED_ARG),
"Log slow queries to given log file. Defaults logging to hostname-slow.log", VALID_RANGE(1, ULONG_MAX), DEFAULT(1), BLOCK_SIZE(1));
&opt_slow_logname, &opt_slow_logname, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, static const char *log_slow_verbosity_names[]= { "innodb", "query_plan", 0 };
{"join_cache_level", OPT_JOIN_CACHE_LEVEL, static Sys_var_set Sys_log_slow_verbosity(
"Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers", "log_slow_verbosity",
&global_system_variables.join_cache_level, "log-slow-verbosity=[value[,value ...]] where value is one of "
&max_system_variables.join_cache_level, "'innodb', 'query_plan'"
0, GET_ULONG, REQUIRED_ARG, 1, 0, 8, 0, 1, 0}, SESSION_VAR(log_slow_verbosity), CMD_LINE(REQUIRED_ARG),
{"mrr_buffer_size", OPT_MRR_BUFFER_SIZE, log_slow_verbosity_names, DEFAULT(LOG_SLOW_VERBOSITY_INIT));
"Size of buffer to use when using MRR with range access",
(uchar**) &global_system_variables.mrr_buff_size, static Sys_var_ulong Sys_join_cache_level(
(uchar**) &max_system_variables.mrr_buff_size, 0, "join_cache_level",
GET_ULONG, REQUIRED_ARG, 256*1024L, IO_SIZE*2+MALLOC_OVERHEAD, "Controls what join operations can be executed with join buffers. Odd "
INT_MAX32, MALLOC_OVERHEAD, 1 /* Small to be able to do tests */ , 0}, "numbers are used for plain join buffers while even numbers are used "
"for linked buffers",
{"sync-sys", OPT_SYNC, SESSION_VAR(join_cache_level), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, 8), DEFAULT(1), BLOCK_SIZE(1));
static Sys_var_ulong Sys_mrr_buffer_size(
"mrr_buffer_size",
"Size of buffer to use when using MRR with range access",
SESSION_VAR(mrr_buff_size), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(IO_SIZE*2, INT_MAX32), DEFAULT(256*1024), BLOCK_SIZE(1));
/* {"sync_sys", OPT_SYNC,
"Enable/disable system sync calls. Should only be turned off when running " "Enable/disable system sync calls. Should only be turned off when running "
"tests or debugging!!", "tests or debugging!!",
&opt_sync, &opt_sync, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, &opt_sync, &opt_sync, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},*/
{"rowid_merge_buff_size", OPT_ROWID_MERGE_BUFF_SIZE,
"The size of the buffers used [NOT] IN evaluation via partial matching.", static Sys_var_ulong Sys_rowid_merge_buff_size(
(uchar**) &global_system_variables.rowid_merge_buff_size, "rowid_merge_buff_size",
(uchar**) &max_system_variables.rowid_merge_buff_size, 0, GET_ULONG, "The size of the buffers used [NOT] IN evaluation via partial matching",
REQUIRED_ARG, 8*1024*1024L, 0, MAX_MEM_TABLE_SIZE/2, 0, 1, 0}, SESSION_VAR(rowid_merge_buff_size), CMD_LINE(REQUIRED_ARG),
{"userstat", OPT_USERSTAT, VALID_RANGE(0, MAX_MEM_TABLE_SIZE/2), DEFAULT(8*1024*1024),
"Control USER_STATISTICS, CLIENT_STATISTICS, INDEX_STATISTICS and TABLE_STATISTICS running", BLOCK_SIZE(1));
(uchar**) &opt_userstat_running, (uchar**) &opt_userstat_running,
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, static Sys_var_mybool Sys_userstat(
case OPT_LOG_SLOW_FILTER: "userstat",
global_system_variables.log_slow_filter= "Enables statistics gathering for USER_STATISTICS, CLIENT_STATISTICS, "
find_bit_type_or_exit(argument, &log_slow_filter_typelib, "INDEX_STATISTICS and TABLE_STATISTICS tables in the INFORMATION_SCHEMA",
opt->name, &error); GLOBAL_VAR(opt_userstat_running),
/* CMD_LINE(OPT_ARG), DEFAULT(TRUE));
If we are using filters, we set opt_slow_admin_statements to be always
true so we can maintain everything with filters
*/
opt_log_slow_admin_statements= 1;
if (error)
return 1;
break;
case OPT_LOG_SLOW_VERBOSITY:
global_system_variables.log_slow_verbosity=
find_bit_type_or_exit(argument, &log_slow_verbosity_typelib,
opt->name, &error);
if (error)
return 1;
break;
...@@ -703,8 +703,9 @@ static bool update_buffer_size(THD *thd, KEY_CACHE *key_cache, ...@@ -703,8 +703,9 @@ static bool update_buffer_size(THD *thd, KEY_CACHE *key_cache,
return error; return error;
} }
static bool update_keycache_param(THD *thd, KEY_CACHE *key_cache, static bool update_keycache(THD *thd, KEY_CACHE *key_cache,
ptrdiff_t offset, ulonglong new_value) ptrdiff_t offset, ulonglong new_value,
(int)(*)(KEY_CACHE *) func)
{ {
bool error= false; bool error= false;
DBUG_ASSERT(offset != offsetof(KEY_CACHE, param_buff_size)); DBUG_ASSERT(offset != offsetof(KEY_CACHE, param_buff_size));
...@@ -713,14 +714,35 @@ static bool update_keycache_param(THD *thd, KEY_CACHE *key_cache, ...@@ -713,14 +714,35 @@ static bool update_keycache_param(THD *thd, KEY_CACHE *key_cache,
key_cache->in_init= 1; key_cache->in_init= 1;
mysql_mutex_unlock(&LOCK_global_system_variables); mysql_mutex_unlock(&LOCK_global_system_variables);
error= ha_resize_key_cache(key_cache); error= func(key_cache);
mysql_mutex_lock(&LOCK_global_system_variables); mysql_mutex_lock(&LOCK_global_system_variables);
key_cache->in_init= 0; key_cache->in_init= 0;
return error; return error;
} }
static bool resize_keycache(THD *thd, KEY_CACHE *key_cache,
ptrdiff_t offset, ulonglong new_value)
{
return update_keycache(thd, key_cache, offset, new_value,
ha_resize_key_cache);
}
static bool change_keycache_param(THD *thd, KEY_CACHE *key_cache,
ptrdiff_t offset, ulonglong new_value)
{
return update_keycache(thd, key_cache, offset, new_value,
ha_change_key_cache_param);
}
static bool repartition_keycache(THD *thd, KEY_CACHE *key_cache,
ptrdiff_t offset, ulonglong new_value)
{
return update_keycache(thd, key_cache, offset, new_value,
ha_repartition_key_cache);
}
/** /**
The class for floating point variables The class for floating point variables
......
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