summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-09-26 23:54:00 +0300
committerMichael Widenius <monty@askmonty.org>2011-09-26 23:54:00 +0300
commitc85d1efc82ef9c946d77424ab58e4e760a392822 (patch)
tree44adbb2ba60761aee046df6fd57109fa79762711 /sql/set_var.cc
parent5c8305651d171fb627adc7907ebfb4db5ea1e57b (diff)
parent7800d93bc3caca0143334941f626dc6aa3ff2b26 (diff)
downloadmariadb-git-c85d1efc82ef9c946d77424ab58e4e760a392822.tar.gz
Automatic merge
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index a934d0dc4dc..289e82f20ee 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -3082,7 +3082,19 @@ void sys_var_thd_time_zone::set_default(THD *thd, enum_var_type type)
bool sys_var_max_user_conn::check(THD *thd, set_var *var)
{
if (var->type == OPT_GLOBAL)
+ {
+ if (! max_user_connections_checking)
+ {
+ /*
+ We can't change the value of max_user_connections from 0 as then
+ connect counting would be wrong.
+ */
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
+ "--max-user-connections=0");
+ return TRUE;
+ }
return sys_var_thd::check(thd, var);
+ }
else
{
/*
@@ -3098,7 +3110,7 @@ bool sys_var_max_user_conn::update(THD *thd, set_var *var)
{
DBUG_ASSERT(var->type == OPT_GLOBAL);
pthread_mutex_lock(&LOCK_global_system_variables);
- max_user_connections= (uint)var->save_result.ulonglong_value;
+ max_user_connections= (int) var->save_result.ulonglong_value;
pthread_mutex_unlock(&LOCK_global_system_variables);
return 0;
}