Debian Codegraph @

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

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