summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-04-09 18:50:28 +0200
committerunknown <serg@serg.mylan>2004-04-09 18:50:28 +0200
commitec15459a0021d1a5163b214610b934bd67983d6b (patch)
treee4d94a27db1586a77efa33e8571cad676359fb9b /sql/set_var.cc
parente51447b1430e854fa0df1f37821e722cdb65d2bb (diff)
downloadmariadb-git-ec15459a0021d1a5163b214610b934bd67983d6b.tar.gz
make session max_delayed_threads to be settable only to 0 or global value
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc21
1 files changed, 19 insertions, 2 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index f47e013eb94..d2224439ddf 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -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 +