summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authordlenev@brandersnatch.localdomain <>2005-01-20 00:54:01 +0300
committerdlenev@brandersnatch.localdomain <>2005-01-20 00:54:01 +0300
commit348218d21d6f49d526e29557783044b11defaabe (patch)
tree4f4ff97c5b4b9d78a131d1adb1230a438c496eb4 /sql
parentcb995131fba471933159765e7d5c453dd63d1f04 (diff)
downloadmariadb-git-348218d21d6f49d526e29557783044b11defaabe.tar.gz
Fix for bug #7637: "Test failure: 'user_limits' on QNX and 64-bit systems"
Made user_limits.test scheduling independant (this solves failure on QNX). Made sys_var_max_user_conn variable int sized. Changed max_user_connections from ulong to uint to be able to use it in sys_var_max_user_conn::value_ptr() (solves failures on 64-bit platforms).
Diffstat (limited to 'sql')
-rw-r--r--sql/mysql_priv.h2
-rw-r--r--sql/mysqld.cc7
-rw-r--r--sql/set_var.cc8
-rw-r--r--sql/set_var.h2
4 files changed, 14 insertions, 5 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 322b38abe13..9d20dc267d5 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -1001,7 +1001,7 @@ extern ulong ha_read_count, ha_discover_count;
extern ulong table_cache_size;
extern ulong max_connections,max_connect_errors, connect_timeout;
extern ulong slave_net_timeout;
-extern ulong max_user_connections;
+extern uint max_user_connections;
extern my_bool timed_mutexes;
extern ulong what_to_log,flush_time;
extern ulong query_buff_size, thread_stack,thread_stack_min;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 35eddb0734f..3e7db0b5fd5 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -333,7 +333,8 @@ ulong delayed_insert_errors,flush_time, thread_created;
ulong specialflag=0;
ulong binlog_cache_use= 0, binlog_cache_disk_use= 0;
ulong max_connections,max_used_connections,
- max_connect_errors, max_user_connections = 0;
+ max_connect_errors;
+uint max_user_connections= 0;
ulong thread_id=1L,current_pid;
my_bool timed_mutexes= 0;
ulong slow_launch_threads = 0, sync_binlog_period;
@@ -5246,8 +5247,8 @@ The minimum value for this variable is 4096.",
REQUIRED_ARG, 32, 1, ~0L, 0, 1, 0},
{"max_user_connections", OPT_MAX_USER_CONNECTIONS,
"The maximum number of active connections for a single user (0 = no limit).",
- (gptr*) &max_user_connections, (gptr*) &max_user_connections, 0, GET_ULONG,
- REQUIRED_ARG, 0, 1, ~0L, 0, 1, 0},
+ (gptr*) &max_user_connections, (gptr*) &max_user_connections, 0, GET_UINT,
+ REQUIRED_ARG, 0, 1, ~0, 0, 1, 0},
{"max_write_lock_count", OPT_MAX_WRITE_LOCK_COUNT,
"After this many write locks, allow some read locks to run in between.",
(gptr*) &max_write_lock_count, (gptr*) &max_write_lock_count, 0, GET_ULONG,
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 957cacc91ac..deb33cf389b 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1599,6 +1599,14 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base)
var_type= OPT_GLOBAL;
}
switch (type()) {
+ case SHOW_INT:
+ {
+ uint value;
+ pthread_mutex_lock(&LOCK_global_system_variables);
+ value= *(uint*) value_ptr(thd, var_type, base);
+ pthread_mutex_unlock(&LOCK_global_system_variables);
+ return new Item_uint((int32) value);
+ }
case SHOW_LONG:
{
ulong value;
diff --git a/sql/set_var.h b/sql/set_var.h
index 7c9f11041c8..0f30f764ed5 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -740,7 +740,7 @@ public:
return type != OPT_GLOBAL || !option_limits;
}
void set_default(THD *thd, enum_var_type type);
- SHOW_TYPE type() { return SHOW_LONG; }
+ SHOW_TYPE type() { return SHOW_INT; }
byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};