mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
make session max_delayed_threads to be settable only to 0 or global value
This commit is contained in:
parent
0ade401777
commit
0d402d8d11
1 changed files with 19 additions and 2 deletions
|
@ -101,6 +101,7 @@ static void fix_myisam_max_sort_file_size(THD *thd, enum_var_type type);
|
|||
static void fix_max_binlog_size(THD *thd, enum_var_type type);
|
||||
static void fix_max_relay_log_size(THD *thd, enum_var_type type);
|
||||
static void fix_max_connections(THD *thd, enum_var_type type);
|
||||
static int check_max_delayed_threads(THD *thd, set_var *var);
|
||||
static void fix_thd_mem_root(THD *thd, enum_var_type type);
|
||||
static void fix_trans_mem_root(THD *thd, enum_var_type type);
|
||||
static KEY_CACHE *create_key_cache(const char *name, uint length);
|
||||
|
@ -201,10 +202,13 @@ sys_var_long_ptr sys_max_connections("max_connections",
|
|||
sys_var_long_ptr sys_max_connect_errors("max_connect_errors",
|
||||
&max_connect_errors);
|
||||
sys_var_thd_ulong sys_max_insert_delayed_threads("max_insert_delayed_threads",
|
||||
&SV::max_insert_delayed_threads);
|
||||
&SV::max_insert_delayed_threads,
|
||||
check_max_delayed_threads,
|
||||
fix_max_connections);
|
||||
sys_var_thd_ulong sys_max_delayed_threads("max_delayed_threads",
|
||||
&SV::max_insert_delayed_threads,
|
||||
0, fix_max_connections);
|
||||
check_max_delayed_threads,
|
||||
fix_max_connections);
|
||||
sys_var_thd_ulong sys_max_error_count("max_error_count",
|
||||
&SV::max_error_count);
|
||||
sys_var_thd_ulong sys_max_heap_table_size("max_heap_table_size",
|
||||
|
@ -1084,6 +1088,19 @@ static void fix_max_relay_log_size(THD *thd, enum_var_type type)
|
|||
}
|
||||
|
||||
|
||||
static int check_max_delayed_threads(THD *thd, set_var *var)
|
||||
{
|
||||
int val= var->value->val_int();
|
||||
if (var->type != OPT_GLOBAL && val != 0 &&
|
||||
val != global_system_variables.max_insert_delayed_threads)
|
||||
{
|
||||
char buf[64];
|
||||
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name, llstr(val, buf));
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void fix_max_connections(THD *thd, enum_var_type type)
|
||||
{
|
||||
resize_thr_alarm(max_connections +
|
||||
|
|
Loading…
Add table
Reference in a new issue