~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/sys_vars/t/max_connections_basic.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
############## mysql-test\t\max_connections_basic.test ###############
 
2
#                                                                             #
 
3
# Variable Name: max_connections                                              #
 
4
# Scope: GLOBAL                                                               #
 
5
# Access Type: Dynamic                                                        #
 
6
# Data Type: numeric                                                          #
 
7
# Default Value:151                                                           #
 
8
# Range:  1-100000                                                            #
 
9
#                                                                             #
 
10
#                                                                             #
 
11
# Creation Date: 2008-02-07                                                   #
 
12
# Author:  Salman                                                             #
 
13
#                                                                             #
 
14
# Description: Test Cases of Dynamic System Variable max_connections          #
 
15
#              that checks the behavior of this variable in the following ways#
 
16
#              * Default Value                                                #
 
17
#              * Valid & Invalid values                                       #
 
18
#              * Scope & Access method                                        #
 
19
#              * Data Integrity                                               #
 
20
#                                                                             #
 
21
# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
 
22
#  server-system-variables.html                                               #
 
23
#                                                                             #
 
24
###############################################################################
 
25
 
 
26
--source include/load_sysvars.inc
 
27
 
 
28
###############################################################
 
29
#              START OF max_connections TESTS                 #
 
30
###############################################################
 
31
 
 
32
 
 
33
###################################################################
 
34
# Saving initial value of max_connections in a temporary variable #
 
35
###################################################################
 
36
 
 
37
SET @start_value = @@global.max_connections;
 
38
SELECT @start_value;
 
39
 
 
40
 
 
41
--echo '#--------------------FN_DYNVARS_074_01------------------------#'
 
42
##################################################################
 
43
#           Display the DEFAULT value of max_connections         #
 
44
##################################################################
 
45
 
 
46
SET @@global.max_connections = 5000;
 
47
SET @@global.max_connections = DEFAULT;
 
48
SELECT @@global.max_connections;
 
49
 
 
50
--echo '#---------------------FN_DYNVARS_074_02-------------------------#'
 
51
############################################### 
 
52
#     Verify default value of variable        #
 
53
############################################### 
 
54
 
 
55
SET @@global.max_connections = @start_value;
 
56
SELECT @@global.max_connections = 151;
 
57
 
 
58
 
 
59
--echo '#--------------------FN_DYNVARS_074_03------------------------#'
 
60
##################################################################
 
61
#    Change the value of max_connections to a valid value        #
 
62
##################################################################
 
63
 
 
64
SET @@global.max_connections = 100000;
 
65
SELECT @@global.max_connections;
 
66
SET @@global.max_connections = 99999;
 
67
SELECT @@global.max_connections;
 
68
SET @@global.max_connections = 65536;
 
69
SELECT @@global.max_connections;
 
70
SET @@global.max_connections = 1;
 
71
SELECT @@global.max_connections;
 
72
SET @@global.max_connections = 2;
 
73
SELECT @@global.max_connections;
 
74
 
 
75
 
 
76
--echo '#--------------------FN_DYNVARS_074_04-------------------------#'
 
77
#####################################################################
 
78
#      Change the value of max_connections to invalid value         #
 
79
#####################################################################
 
80
 
 
81
SET @@global.max_connections = -1;
 
82
SELECT @@global.max_connections;
 
83
SET @@global.max_connections = 100000000000;
 
84
SELECT @@global.max_connections;
 
85
--Error ER_WRONG_TYPE_FOR_VAR
 
86
SET @@global.max_connections = 10000.01;
 
87
SELECT @@global.max_connections;
 
88
SET @@global.max_connections = -1024;
 
89
SELECT @@global.max_connections;
 
90
SET @@global.max_connections = 0;
 
91
SELECT @@global.max_connections;
 
92
SET @@global.max_connections = 100001;
 
93
SELECT @@global.max_connections;
 
94
 
 
95
--Error ER_WRONG_TYPE_FOR_VAR
 
96
SET @@global.max_connections = ON;
 
97
SELECT @@global.max_connections;
 
98
--Error ER_WRONG_TYPE_FOR_VAR
 
99
SET @@global.max_connections = 'test';
 
100
SELECT @@global.max_connections;
 
101
 
 
102
 
 
103
--echo '#-------------------FN_DYNVARS_074_05----------------------------#'
 
104
##################################################################### 
 
105
#       Test if accessing session max_connections gives error       #
 
106
#####################################################################
 
107
 
 
108
--Error ER_GLOBAL_VARIABLE
 
109
SET @@session.max_connections = 4096;
 
110
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
 
111
SELECT @@session.max_connections;
 
112
 
 
113
 
 
114
--echo '#----------------------FN_DYNVARS_074_06------------------------#'
 
115
############################################################################## 
 
116
# Check if the value in GLOBAL & SESSION Tables matches values in variable   #
 
117
##############################################################################
 
118
 
 
119
SELECT @@global.max_connections = VARIABLE_VALUE 
 
120
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 
121
WHERE VARIABLE_NAME='max_connections';
 
122
 
 
123
SELECT @@max_connections = VARIABLE_VALUE 
 
124
FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 
125
WHERE VARIABLE_NAME='max_connections';
 
126
 
 
127
 
 
128
--echo '#---------------------FN_DYNVARS_074_07----------------------#'
 
129
################################################################### 
 
130
#      Check if TRUE and FALSE values can be used on variable     #
 
131
################################################################### 
 
132
 
 
133
SET @@global.max_connections = TRUE;
 
134
SELECT @@global.max_connections;
 
135
SET @@global.max_connections = FALSE;
 
136
SELECT @@global.max_connections;
 
137
 
 
138
 
 
139
--echo '#---------------------FN_DYNVARS_074_08----------------------#'
 
140
########################################################################################################
 
141
#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
 
142
########################################################################################################
 
143
 
 
144
SET @@global.max_connections = 5000;
 
145
SELECT @@max_connections = @@global.max_connections;
 
146
 
 
147
 
 
148
--echo '#---------------------FN_DYNVARS_074_09----------------------#'
 
149
##########################################################################
 
150
#   Check if max_connections can be accessed with and without @@ sign    #
 
151
##########################################################################
 
152
 
 
153
--Error ER_GLOBAL_VARIABLE
 
154
SET max_connections = 6000;
 
155
SELECT @@max_connections;
 
156
--Error ER_PARSE_ERROR
 
157
SET local.max_connections = 7000;
 
158
--Error ER_UNKNOWN_TABLE
 
159
SELECT local.max_connections;
 
160
--Error ER_PARSE_ERROR
 
161
SET global.max_connections = 8000;
 
162
--Error ER_UNKNOWN_TABLE
 
163
SELECT global.max_connections;
 
164
--Error ER_BAD_FIELD_ERROR
 
165
SELECT max_connections = @@session.max_connections;
 
166
 
 
167
 
 
168
##############################  
 
169
#   Restore initial value    #
 
170
##############################
 
171
 
 
172
SET @@global.max_connections = @start_value;
 
173
SELECT @@global.max_connections;
 
174
 
 
175
 
 
176
##################################################################
 
177
#              END OF max_connections TESTS                      #
 
178
##################################################################
 
179