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 SET @start_session_value = @@session.max_heap_table_size;
39 SELECT @start_session_value = @start_global_value;
40
41
42 --echo '#--------------------FN_DYNVARS_077_01-------------------------#'
43 ###############################################################
44 # Display the DEFAULT value of max_heap_table_size #
45 ###############################################################
46
47 SET @@global.max_heap_table_size = 1677721610;
48 SET @@global.max_heap_table_size = DEFAULT;
49 SELECT @@global.max_heap_table_size > 0;
50
51 SET @@session.max_heap_table_size = 1677721610;
52 SET @@session.max_heap_table_size = DEFAULT;
53 SELECT @@session.max_heap_table_size > 0;
54
55
56 --echo '#--------------------FN_DYNVARS_077_03-------------------------#'
57 ############################################################################
58 # Change the value of max_heap_table_size to a valid value for GLOBAL Scope #
59 ############################################################################
60
61 SET @@global.max_heap_table_size = 16384;
62 SELECT @@global.max_heap_table_size;
63 SET @@global.max_heap_table_size = 16385;
64 SELECT @@global.max_heap_table_size;
65 SET @@global.max_heap_table_size = 65535;
66 SELECT @@global.max_heap_table_size;
67 SET @@global.max_heap_table_size = 4294967294;
68 SELECT @@global.max_heap_table_size;
69 SET @@global.max_heap_table_size = 4294967295;
70 SELECT @@global.max_heap_table_size;
71
72 --echo '#--------------------FN_DYNVARS_077_04-------------------------#'
73 #############################################################################
74 # Change the value of max_heap_table_size to a valid value for SESSION Scope #
75 #############################################################################
76
77 SET @@session.max_heap_table_size = 16384;
78 SELECT @@session.max_heap_table_size;
79 SET @@session.max_heap_table_size = 16385;
80 SELECT @@session.max_heap_table_size;
81 SET @@session.max_heap_table_size = 65535;
82 SELECT @@session.max_heap_table_size;
83 SET @@session.max_heap_table_size = 4294967294;
84 SELECT @@session.max_heap_table_size;
85 SET @@session.max_heap_table_size = 4294967295;
86 SELECT @@session.max_heap_table_size;
87
88 --echo '#------------------FN_DYNVARS_077_05-----------------------#'
89 ##############################################################
90 # Change the value of max_heap_table_size to an invalid value #
91 ##############################################################
92
93 SET @@global.max_heap_table_size = -1;
94 SELECT @@global.max_heap_table_size;
95 SET @@global.max_heap_table_size = -1024;
96 SELECT @@global.max_heap_table_size;
97 SET @@global.max_heap_table_size = 1024;
98 SELECT @@global.max_heap_table_size;
99 SET @@global.max_heap_table_size = 16383;
100 SELECT @@global.max_heap_table_size;
101 --disable_warnings
102 SET @@global.max_heap_table_size = 4294967296;
103 --enable_warnings
104 --replace_result 4294966272 4294967296
105 SELECT @@global.max_heap_table_size;
106 --Error ER_WRONG_TYPE_FOR_VAR
107 SET @@global.max_heap_table_size = 65530.34;
108 --replace_result 4294966272 4294967296
109 SELECT @@global.max_heap_table_size;
110 --Error ER_WRONG_TYPE_FOR_VAR
111 SET @@global.max_heap_table_size = test;
112 --replace_result 4294966272 4294967296
113 SELECT @@global.max_heap_table_size;
114
115 SET @@session.max_heap_table_size = -1;
116 SELECT @@session.max_heap_table_size;
117 SET @@session.max_heap_table_size = 16383;
118 SELECT @@session.max_heap_table_size;
119 --disable_warnings
120 SET @@session.max_heap_table_size = 4294967296;
121 --enable_warnings
122 --replace_result 4294966272 4294967296
123 SELECT @@session.max_heap_table_size;
124 --Error ER_WRONG_TYPE_FOR_VAR
125 SET @@session.max_heap_table_size = 65530.34;
126 SET @@session.max_heap_table_size = 10737418241;
127 --replace_result 4294966272 10737418240
128 SELECT @@session.max_heap_table_size;
129
130 --Error ER_WRONG_TYPE_FOR_VAR
131 SET @@session.max_heap_table_size = test;
132 --replace_result 4294966272 10737418240
133 SELECT @@session.max_heap_table_size;
134
135
136 --echo '#------------------FN_DYNVARS_077_06-----------------------#'
137 ####################################################################
138 # Check if the value in GLOBAL Table matches value in variable #
139 ####################################################################
140
141
142 SELECT @@global.max_heap_table_size = VARIABLE_VALUE
143 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
144 WHERE VARIABLE_NAME='max_heap_table_size';
145
146 --echo '#------------------FN_DYNVARS_077_07-----------------------#'
147 ####################################################################
148 # Check if the value in SESSION Table matches value in variable #
149 ####################################################################
150
151 SELECT @@session.max_heap_table_size = VARIABLE_VALUE
152 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
153 WHERE VARIABLE_NAME='max_heap_table_size';
154
155
156 --echo '#------------------FN_DYNVARS_077_08-----------------------#'
157 ####################################################################
158 # Check if TRUE and FALSE values can be used on variable #
159 ####################################################################
160
161 SET @@global.max_heap_table_size = TRUE;
162 SELECT @@global.max_heap_table_size;
163 SET @@global.max_heap_table_size = FALSE;
164 SELECT @@global.max_heap_table_size;
165
166
167 --echo '#---------------------FN_DYNVARS_077_09----------------------#'
168 #################################################################################
169 # Check if accessing variable with and without GLOBAL point to same variable #
170 #################################################################################
171
172 SET @@global.max_heap_table_size = 163845;
173 SELECT @@max_heap_table_size = @@global.max_heap_table_size;
174
175
176 --echo '#---------------------FN_DYNVARS_077_10----------------------#'
177 ########################################################################################################
178 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
179 ########################################################################################################
180
181 SET @@max_heap_table_size = 16777216;
182 SELECT @@max_heap_table_size = @@local.max_heap_table_size;
183 SELECT @@local.max_heap_table_size = @@session.max_heap_table_size;
184
185
186 --echo '#---------------------FN_DYNVARS_077_11----------------------#'
187 #############################################################################
188 # Check if max_heap_table_size can be accessed with and without @@ sign #
189 #############################################################################
190
191 SET max_heap_table_size = 316777216;
192 SELECT @@max_heap_table_size;
193 --Error ER_UNKNOWN_TABLE
194 SELECT local.max_heap_table_size;
195 --Error ER_UNKNOWN_TABLE
196 SELECT session.max_heap_table_size;
197 --Error ER_BAD_FIELD_ERROR
198 SELECT max_heap_table_size = @@session.max_heap_table_size;
199
200
201 ####################################
202 # Restore initial value #
203 ####################################
204
205 SET @@global.max_heap_table_size = @start_global_value;
206
207
208 #######################################################
209 # END OF max_heap_table_size TESTS #
210 #######################################################