Debian Codegraph @

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

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