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
129 SET @@session.max_sp_recursion_depth = 256;
130 SELECT @@session.max_sp_recursion_depth;
131 SET @@session.max_sp_recursion_depth = -1;
132 SELECT @@session.max_sp_recursion_depth;
133 SET @@session.max_sp_recursion_depth = 500000;
134 SELECT @@session.max_sp_recursion_depth;
135 SET @@session.max_sp_recursion_depth = -001;
136 SELECT @@session.max_sp_recursion_depth;
137 --Error ER_WRONG_TYPE_FOR_VAR
138 SET @@session.max_sp_recursion_depth = 65530.34;
139 SET @@session.max_sp_recursion_depth = 10737418241;
140 SELECT @@session.max_sp_recursion_depth;
141 --Error ER_WRONG_TYPE_FOR_VAR
142 SET @@session.max_sp_recursion_depth = test;
143 SELECT @@session.max_sp_recursion_depth;
144
145
146 --echo '#------------------FN_DYNVARS_085_06-----------------------#'
147 ####################################################################
148 # Check if the value in GLOBAL Table matches value in variable #
149 ####################################################################
150
151
152 SELECT @@global.max_sp_recursion_depth = VARIABLE_VALUE
153 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
154 WHERE VARIABLE_NAME='max_sp_recursion_depth';
155
156 --echo '#------------------FN_DYNVARS_085_07-----------------------#'
157 ####################################################################
158 # Check if the value in SESSION Table matches value in variable #
159 ####################################################################
160
161 SELECT @@session.max_sp_recursion_depth = VARIABLE_VALUE
162 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
163 WHERE VARIABLE_NAME='max_sp_recursion_depth';
164
165
166 --echo '#------------------FN_DYNVARS_085_08-----------------------#'
167 ####################################################################
168 # Check if TRUE and FALSE values can be used on variable #
169 ####################################################################
170
171 SET @@global.max_sp_recursion_depth = TRUE;
172 SELECT @@global.max_sp_recursion_depth;
173 SET @@global.max_sp_recursion_depth = FALSE;
174 SELECT @@global.max_sp_recursion_depth;
175
176
177 --echo '#---------------------FN_DYNVARS_085_09----------------------#'
178 #################################################################################
179 # Check if accessing variable with and without GLOBAL point to same variable #
180 #################################################################################
181
182 SET @@global.max_sp_recursion_depth = 20;
183 SELECT @@max_sp_recursion_depth = @@global.max_sp_recursion_depth;
184
185
186 --echo '#---------------------FN_DYNVARS_085_10----------------------#'
187 ########################################################################################################
188 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
189 ########################################################################################################
190
191 SET @@max_sp_recursion_depth = 255;
192 SELECT @@max_sp_recursion_depth = @@local.max_sp_recursion_depth;
193 SELECT @@local.max_sp_recursion_depth = @@session.max_sp_recursion_depth;
194
195
196 --echo '#---------------------FN_DYNVARS_085_11----------------------#'
197 ##########################################################################
198 # Check if max_sp_recursion_depth can be accessed with and without @@ sign #
199 ##########################################################################
200
201
202 SET max_sp_recursion_depth = 102;
203 SELECT @@max_sp_recursion_depth;
204 --Error ER_UNKNOWN_TABLE
205 SELECT local.max_sp_recursion_depth;
206 --Error ER_UNKNOWN_TABLE
207 SELECT session.max_sp_recursion_depth;
208 --Error ER_BAD_FIELD_ERROR
209 SELECT max_sp_recursion_depth = @@session.max_sp_recursion_depth;
210
211
212 ####################################
213 # Restore initial value #
214 ####################################
215
216 SET @@global.max_sp_recursion_depth = @start_global_value;
217 SELECT @@global.max_sp_recursion_depth;
218 SET @@session.max_sp_recursion_depth = @start_session_value;
219 SELECT @@session.max_sp_recursion_depth;
220
221
222 ####################################################
223 # END OF max_sp_recursion_depth TESTS #
224 ####################################################
225