Debian Codegraph @

mysql-test/suite/sys_vars/t/max_delayed_threads_basic.test

raw
1 ############## mysql-test\t\max_delayed_threads_basic.test ###############
2 # #
3 # Variable Name: max_delayed_threads #
4 # Scope: GLOBAL | SESSION #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: 20 #
8 # Range: 0-16384 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman #
13 # #
14 # Description: Test Cases of Dynamic System Variable max_delayed_threads #
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_delayed_threads TESTS #
30 ##################################################################
31
32
33 #############################################################
34 # Save initial value #
35 #############################################################
36
37 SET @start_global_value = @@global.max_delayed_threads;
38 SELECT @start_global_value;
39 SET @start_session_value = @@session.max_delayed_threads;
40 SELECT @start_session_value;
41
42
43 --echo '#--------------------FN_DYNVARS_075_01-------------------------#'
44 ##################################################################
45 # Display the DEFAULT value of max_delayed_threads #
46 ##################################################################
47
48 SET @@global.max_delayed_threads = 1000;
49 SET @@global.max_delayed_threads = DEFAULT;
50 SELECT @@global.max_delayed_threads;
51
52 --Error ER_WRONG_VALUE_FOR_VAR
53 SET @@session.max_delayed_threads = 1000;
54 SET @@session.max_delayed_threads = DEFAULT;
55 SELECT @@session.max_delayed_threads;
56
57
58 --echo '#--------------------FN_DYNVARS_075_02-------------------------#'
59 ##################################################################
60 # Check the DEFAULT value of max_delayed_threads #
61 ##################################################################
62
63 SET @@global.max_delayed_threads = DEFAULT;
64 SELECT @@global.max_delayed_threads = 20;
65
66 SET @@session.max_delayed_threads = DEFAULT;
67 SELECT @@session.max_delayed_threads = 20;
68
69
70 --echo '#--------------------FN_DYNVARS_075_03-------------------------#'
71 ############################################################################
72 # Change the value of max_delayed_threads to a valid value for GLOBAL Scope #
73 ############################################################################
74
75 SET @@global.max_delayed_threads = 1;
76 SELECT @@global.max_delayed_threads;
77 SET @@global.max_delayed_threads = 1025;
78 SELECT @@global.max_delayed_threads;
79
80 SET @@global.max_delayed_threads = 0;
81 SELECT @@global.max_delayed_threads;
82 SET @@global.max_delayed_threads = 16384;
83 SELECT @@global.max_delayed_threads;
84 SET @@global.max_delayed_threads = 16383;
85 SELECT @@global.max_delayed_threads;
86
87 --echo '#--------------------FN_DYNVARS_075_04-------------------------#'
88 #############################################################################
89 # Change the value of max_delayed_threads to a valid value for SESSION Scope #
90 #############################################################################
91
92 --Error ER_WRONG_VALUE_FOR_VAR
93 SET @@session.max_delayed_threads = 1;
94 SELECT @@session.max_delayed_threads;
95 --Error ER_WRONG_VALUE_FOR_VAR
96 SET @@session.max_delayed_threads = 1025;
97 SELECT @@session.max_delayed_threads;
98
99 SET @@session.max_delayed_threads = 0;
100 SELECT @@session.max_delayed_threads;
101 --Error ER_WRONG_VALUE_FOR_VAR
102 SET @@session.max_delayed_threads = 16384;
103 SELECT @@session.max_delayed_threads;
104
105 SET @@session.max_delayed_threads = 16383;
106 SELECT @@session.max_delayed_threads;
107
108
109 --echo '#------------------FN_DYNVARS_075_05-----------------------#'
110 ##############################################################
111 # Change the value of max_delayed_threads to an invalid value #
112 ##############################################################
113
114 SET @@global.max_delayed_threads = -1024;
115 SELECT @@global.max_delayed_threads;
116 SET @@global.max_delayed_threads = -1;
117 SELECT @@global.max_delayed_threads;
118 SET @@global.max_delayed_threads = 16385;
119 SELECT @@global.max_delayed_threads;
120 --Error ER_WRONG_TYPE_FOR_VAR
121 SET @@global.max_delayed_threads = 65530.34;
122 SELECT @@global.max_delayed_threads;
123 --Error ER_WRONG_TYPE_FOR_VAR
124 SET @@global.max_delayed_threads = test;
125 SELECT @@global.max_delayed_threads;
126 SET @@session.max_delayed_threads = 16385;
127 SELECT @@session.max_delayed_threads;
128 SET @@session.max_delayed_threads = -1;
129 SELECT @@session.max_delayed_threads;
130 SET @@session.max_delayed_threads = -2;
131 SELECT @@session.max_delayed_threads;
132 --Error ER_WRONG_TYPE_FOR_VAR
133 SET @@session.max_delayed_threads = 65530.34;
134 SET @@session.max_delayed_threads = 10737418241;
135 SELECT @@session.max_delayed_threads;
136
137
138 --Error ER_WRONG_TYPE_FOR_VAR
139 SET @@session.max_delayed_threads = test;
140 SELECT @@session.max_delayed_threads;
141
142
143 --echo '#------------------FN_DYNVARS_075_06-----------------------#'
144 ####################################################################
145 # Check if the value in GLOBAL Table matches value in variable #
146 ####################################################################
147
148
149 SELECT @@global.max_delayed_threads = VARIABLE_VALUE
150 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
151 WHERE VARIABLE_NAME='max_delayed_threads';
152
153 --echo '#------------------FN_DYNVARS_075_07-----------------------#'
154 ####################################################################
155 # Check if the value in SESSION Table matches value in variable #
156 ####################################################################
157
158 SELECT @@session.max_delayed_threads = VARIABLE_VALUE
159 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
160 WHERE VARIABLE_NAME='max_delayed_threads';
161
162
163 --echo '#------------------FN_DYNVARS_075_08-----------------------#'
164 ####################################################################
165 # Check if TRUE and FALSE values can be used on variable #
166 ####################################################################
167
168 SET @@global.max_delayed_threads = TRUE;
169 SELECT @@global.max_delayed_threads;
170 SET @@global.max_delayed_threads = FALSE;
171 SELECT @@global.max_delayed_threads;
172
173
174 --echo '#---------------------FN_DYNVARS_001_09----------------------#'
175 #################################################################################
176 # Check if accessing variable with and without GLOBAL point to same variable #
177 #################################################################################
178
179 SET @@global.max_delayed_threads = 2048;
180 SELECT @@max_delayed_threads = @@global.max_delayed_threads;
181
182
183 --echo '#---------------------FN_DYNVARS_001_10----------------------#'
184 ########################################################################################################
185 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
186 ########################################################################################################
187
188 --Error ER_WRONG_VALUE_FOR_VAR
189 SET @@max_delayed_threads = 100000;
190 SELECT @@max_delayed_threads = @@local.max_delayed_threads;
191 SELECT @@local.max_delayed_threads = @@session.max_delayed_threads;
192
193
194 --echo '#---------------------FN_DYNVARS_001_11----------------------#'
195 #############################################################################
196 # Check if max_delayed_threads can be accessed with and without @@ sign #
197 #############################################################################
198
199 --Error ER_WRONG_VALUE_FOR_VAR
200 SET max_delayed_threads = 1024;
201 SELECT @@max_delayed_threads;
202 --Error ER_UNKNOWN_TABLE
203 SELECT local.max_delayed_threads;
204 --Error ER_UNKNOWN_TABLE
205 SELECT session.max_delayed_threads;
206 --Error ER_BAD_FIELD_ERROR
207 SELECT max_delayed_threads = @@session.max_delayed_threads;
208
209
210 ####################################
211 # Restore initial value #
212 ####################################
213
214 SET @@global.max_delayed_threads = @start_global_value;
215 SELECT @@global.max_delayed_threads;
216 SET @@session.max_delayed_threads = @start_session_value;
217 SELECT @@session.max_delayed_threads;
218
219
220 #######################################################
221 # END OF max_delayed_threads TESTS #
222 #######################################################
223