1
############## mysql-test\t\max_user_connections_basic.test ###############
3
# Variable Name: max_user_connections #
4
# Scope: GLOBAL | SESSION #
5
# Access Type: Dynamic #
8
# Range: 1-4294967295 #
11
# Creation Date: 2008-02-07 #
14
# Description: Test Cases of Dynamic System Variable max_user_connections #
15
# that checks the behavior of this variable in the following ways#
17
# * Valid & Invalid values #
18
# * Scope & Access method #
21
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
22
# server-system-variables.html #
24
###############################################################################
26
--source include/load_sysvars.inc
28
####################################
29
# START OF max_user_connections TESTS #
30
####################################
33
#############################################################
34
# Save initial value #
35
#############################################################
37
SET @start_global_value = @@global.max_user_connections;
38
SELECT @start_global_value;
39
SET @start_session_value = @@session.max_user_connections;
40
SELECT @start_session_value;
43
--echo '#--------------------FN_DYNVARS_087_01-------------------------#'
44
######################################################
45
# Display the DEFAULT value of max_user_connections #
46
######################################################
48
SET @@global.max_user_connections = 1000;
49
SET @@global.max_user_connections = DEFAULT;
50
SELECT @@global.max_user_connections;
52
--Error ER_GLOBAL_VARIABLE
53
SET @@session.max_user_connections = 1000;
55
SET @@session.max_user_connections = DEFAULT;
56
SELECT @@session.max_user_connections;
57
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
60
--echo '#--------------------FN_DYNVARS_087_02-------------------------#'
61
######################################################
62
# Check the DEFAULT value of max_user_connections #
63
######################################################
65
SET @@global.max_user_connections = DEFAULT;
66
SELECT @@global.max_user_connections = 0;
69
SET @@session.max_user_connections = DEFAULT;
70
SELECT @@session.max_user_connections = 0;
74
--echo '#--------------------FN_DYNVARS_087_03-------------------------#'
75
########################################################################
76
# Change the value of max_user_connections to a valid value for GLOBAL Scope #
77
########################################################################
79
SET @@global.max_user_connections = 1;
80
SELECT @@global.max_user_connections;
81
SET @@global.max_user_connections = 2;
82
SELECT @@global.max_user_connections;
83
SET @@global.max_user_connections = 65536;
84
SELECT @@global.max_user_connections;
85
SET @@global.max_user_connections = 4294967295;
86
SELECT @@global.max_user_connections;
87
SET @@global.max_user_connections = 4294967294;
88
SELECT @@global.max_user_connections;
92
--echo '#------------------FN_DYNVARS_087_05-----------------------#'
93
##########################################################
94
# Change the value of max_user_connections to an invalid value #
95
##########################################################
97
SET @@global.max_user_connections = -1024;
98
SELECT @@global.max_user_connections;
99
SET @@global.max_user_connections = 4294967296;
100
SELECT @@global.max_user_connections;
101
SET @@global.max_user_connections = -1;
102
SELECT @@global.max_user_connections;
103
SET @@global.max_user_connections = 429496729500;
104
SELECT @@global.max_user_connections;
105
--Error ER_PARSE_ERROR
106
SET @@global.max_user_connections = 65530.34.;
107
SELECT @@global.max_user_connections;
108
--Error ER_WRONG_TYPE_FOR_VAR
109
SET @@global.max_user_connections = test;
110
SELECT @@global.max_user_connections;
114
--echo '#------------------FN_DYNVARS_087_06-----------------------#'
115
####################################################################
116
# Check if the value in GLOBAL Table matches value in variable #
117
####################################################################
120
SELECT @@global.max_user_connections = VARIABLE_VALUE
121
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
122
WHERE VARIABLE_NAME='max_user_connections';
125
--echo '#------------------FN_DYNVARS_087_08-----------------------#'
126
####################################################################
127
# Check if TRUE and FALSE values can be used on variable #
128
####################################################################
130
SET @@global.max_user_connections = TRUE;
131
SELECT @@global.max_user_connections;
132
SET @@global.max_user_connections = FALSE;
133
SELECT @@global.max_user_connections;
136
--echo '#---------------------FN_DYNVARS_087_09----------------------#'
137
#################################################################################
138
# Check if accessing variable with and without GLOBAL point to same variable #
139
#################################################################################
141
SET @@global.max_user_connections = 20;
142
SELECT @@max_user_connections = @@global.max_user_connections;
145
--echo '#---------------------FN_DYNVARS_087_11----------------------#'
146
#########################################################################
147
# Check if max_user_connections can be accessed with and without @@ sign #
148
#########################################################################
151
SET @@global.max_user_connections = 102;
152
SELECT @@max_user_connections;
153
--Error ER_UNKNOWN_TABLE
154
SELECT local.max_user_connections;
155
--Error ER_UNKNOWN_TABLE
156
SELECT session.max_user_connections;
157
--Error ER_BAD_FIELD_ERROR
158
SELECT max_user_connections = @@session.max_user_connections;
161
####################################
162
# Restore initial value #
163
####################################
165
SET @@global.max_user_connections = @start_global_value;
166
SELECT @@global.max_user_connections;
169
###################################################
170
# END OF max_user_connections TESTS #
171
###################################################