1
############# mysql-test\t\max_user_connections_func.test ####################
3
# Variable Name: max_user_connections #
5
# Access Type: Dynamic #
8
# Values: 1-4294967295 #
11
# Creation Date: 2008-03-02 #
12
# Author: Sharique Abdullah #
14
# Description: Test Cases of Dynamic System Variable "max_user_connections #
15
# that checks behavior of this variable in the following ways #
16
# * Functionality based on different values #
19
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
20
# option_mysqld_max_user_connections #
22
# Modified: 2008-07-10 HHUNGER: Inserted wait condition #
24
##############################################################################
32
--source include/not_embedded.inc
34
SET @default_max_user_connections = @@global.max_user_connections;
36
###################################
37
#Setting value max_user_connection#
38
###################################
40
Set Global max_user_connections=2;
42
--echo '#--------------------FN_DYNVARS_114_01-------------------------#'
43
########################################
44
#Should not make more then 2 connection#
45
########################################
47
--echo ** Connecting conn1 using username 'root' **
48
CONNECT (conn1,localhost,root,,);
50
--echo ** Connecting conn2 using username 'root' **
51
CONNECT (conn2,localhost,root,,);
53
--echo ** Connecting conn3 using username 'root' **
55
--Error ER_TOO_MANY_USER_CONNECTIONS
56
CONNECT (conn3,localhost,root,,);
58
--echo Expected error "too many connections"
60
--echo ** Disconnecting conn1 **
63
--echo ** Poll till disconnected conn1 disappears from processlist
64
let $wait_condition= SELECT count(id) <= 2
65
FROM information_schema.processlist WHERE user = 'root';
66
--source include/wait_condition.inc
68
--echo '#--------------------FN_DYNVARS_114_02-------------------------#'
69
#####################################################
70
#Set value to 3 and see if 3 connections can be made#
71
#####################################################
73
Set Global max_user_connections=3;
74
--echo ** Connecting conn5 using username 'root' **
75
CONNECT (conn5,localhost,root,,);
76
--echo ** Connecting conn6 using username 'root' **
77
CONNECT (conn6,localhost,root,,);
83
--echo ** Connection default **
86
--echo ** Disconnecting conn5, conn6 **
91
SET @@global.max_user_connections = @default_max_user_connections;