Debian Codegraph @

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

raw
1 ########################### tmp_table_size_basic.test ##########################
2 # #
3 # Variable Name: tmp_table_size #
4 # Scope: GLOBAL | SESSION #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: system dependend #
8 # Range: 1024-system dependend #
9 # #
10 # #
11 # Creation Date: 2008-02-13 #
12 # Author: Salman #
13 # #
14 # Description: Test Cases of Dynamic System Variable tmp_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 # Modified: 2008-12-04 HHunger #
21 # removed the differences between 64 and 32 bit platforms #
22 # #
23 # Reference: #
24 # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
25 # #
26 ################################################################################
27
28 --source include/load_sysvars.inc
29
30 ##############################################################
31 # START OF tmp_table_size TESTS #
32 ##############################################################
33
34 #############################################################
35 # Save initial value #
36 #############################################################
37
38 SET @start_global_value = @@global.tmp_table_size;
39 SET @start_session_value = @@session.tmp_table_size;
40
41 --echo '#--------------------FN_DYNVARS_005_01-------------------------#'
42 ##############################################################
43 # Display the DEFAULT value of tmp_table_size #
44 ##############################################################
45
46 SET @@global.tmp_table_size = 100;
47 SET @@global.tmp_table_size = DEFAULT;
48
49 SET @@session.tmp_table_size = 200;
50 SET @@session.tmp_table_size = DEFAULT;
51
52 --echo '#--------------------FN_DYNVARS_005_02-------------------------#'
53 ########################################################################
54 # Check the DEFAULT value of tmp_table_size #
55 ########################################################################
56 # The DEFAULT value is system dependend.
57 # Therefore we have only a plausibility check here
58 SELECT @@global.tmp_table_size >= 16777216;
59
60 SELECT @@session.tmp_table_size >= 16777216;
61
62 --echo '#--------------------FN_DYNVARS_005_03-------------------------#'
63 ########################################################################
64 # Change the value of tmp_table_size to a valid value for GLOBAL Scope #
65 ########################################################################
66
67 SET @@global.tmp_table_size = 1024;
68 SELECT @@global.tmp_table_size;
69 SET @@global.tmp_table_size = 60020;
70 SELECT @@global.tmp_table_size;
71 SET @@global.tmp_table_size = 4294967295;
72 SELECT @@global.tmp_table_size;
73
74
75 --echo '#--------------------FN_DYNVARS_005_04-------------------------#'
76 #########################################################################
77 # Change the value of tmp_table_size to a valid value for SESSION Scope #
78 #########################################################################
79
80 SET @@session.tmp_table_size = 1024;
81 SELECT @@session.tmp_table_size;
82
83 SET @@session.tmp_table_size = 4294967295;
84 SELECT @@session.tmp_table_size;
85 SET @@session.tmp_table_size = 65535;
86 SELECT @@session.tmp_table_size;
87
88
89 --echo '#------------------FN_DYNVARS_005_05-----------------------#'
90 ##########################################################
91 # Change the value of tmp_table_size to an invalid value #
92 ##########################################################
93
94 SET @@global.tmp_table_size = 0;
95 SELECT @@global.tmp_table_size;
96
97 SET @@global.tmp_table_size = -1024;
98 SELECT @@global.tmp_table_size;
99
100
101 SET @@global.tmp_table_size = 1000;
102 SELECT @@global.tmp_table_size;
103 SET @@global.tmp_table_size = 4294967299;
104 SELECT @@global.tmp_table_size;
105 --Error ER_WRONG_TYPE_FOR_VAR
106 SET @@global.tmp_table_size = ' ';
107 SELECT @@global.tmp_table_size;
108
109 --Error ER_WRONG_TYPE_FOR_VAR
110 SET @@global.tmp_table_size = ON;
111
112 --Error ER_WRONG_TYPE_FOR_VAR
113 SET @@global.tmp_table_size = OFF;
114
115 SET @@global.tmp_table_size = True;
116 SELECT @@global.tmp_table_size;
117
118 SET @@global.tmp_table_size = False;
119 SELECT @@global.tmp_table_size;
120
121 --Error ER_WRONG_TYPE_FOR_VAR
122 SET @@global.tmp_table_size = 65530.34;
123
124 --Error ER_WRONG_TYPE_FOR_VAR
125 SET @@global.tmp_table_size ="Test";
126
127 --Error ER_WRONG_TYPE_FOR_VAR
128 SET @@session.tmp_table_size = ON;
129
130 --Error ER_WRONG_TYPE_FOR_VAR
131 SET @@session.tmp_table_size = OFF;
132
133 SET @@session.tmp_table_size = True;
134 SELECT @@session.tmp_table_size;
135
136 --Error ER_WRONG_TYPE_FOR_VAR
137 SET @@session.tmp_table_size = 65530.34;
138
139 SET @@session.tmp_table_size = False;
140 SELECT @@session.tmp_table_size;
141
142 --Error ER_WRONG_TYPE_FOR_VAR
143 SET @@session.tmp_table_size = "Test";
144
145 --Error ER_WRONG_TYPE_FOR_VAR
146 SET @@session.tmp_table_size = ' ';
147 SELECT @@session.tmp_table_size;
148
149 SET @@session.tmp_table_size = 1000;
150 SELECT @@session.tmp_table_size;
151 SET @@session.tmp_table_size = 12345678901;
152
153 # With a 64 bit mysqld:12345678901,with a 32 bit mysqld: 4294967295
154 SELECT @@session.tmp_table_size IN (12345678901,4294967295);
155
156 --echo '#------------------FN_DYNVARS_005_06-----------------------#'
157 ####################################################################
158 # Check if the value in GLOBAL Table matches value in variable #
159 ####################################################################
160
161 --disable_warnings
162 SELECT @@global.tmp_table_size = VARIABLE_VALUE
163 FROM performance_schema.global_variables
164 WHERE VARIABLE_NAME='tmp_table_size';
165 --enable_warnings
166
167 --echo '#------------------FN_DYNVARS_005_07-----------------------#'
168 ####################################################################
169 # Check if the value in SESSION Table matches value in variable #
170 ####################################################################
171
172 --disable_warnings
173 SELECT @@session.tmp_table_size = VARIABLE_VALUE
174 FROM performance_schema.session_variables
175 WHERE VARIABLE_NAME='tmp_table_size';
176 --enable_warnings
177
178 --echo '#---------------------FN_DYNVARS_001_09----------------------#'
179 ########################################################################
180 # Check if global and session variables are independent of each other #
181 ########################################################################
182
183 SET @@global.tmp_table_size = 1024;
184 SET @@tmp_table_size = 4294967295;
185 SELECT @@tmp_table_size = @@global.tmp_table_size;
186
187 --echo '#---------------------FN_DYNVARS_001_10----------------------#'
188 ##################################################################
189 # Check if accessing variable with SESSION,LOCAL and without #
190 # SCOPE points to same session variable #
191 ##################################################################
192
193 SET @@tmp_table_size = 100;
194 SELECT @@tmp_table_size = @@local.tmp_table_size;
195 SELECT @@local.tmp_table_size = @@session.tmp_table_size;
196
197
198 --echo '#---------------------FN_DYNVARS_001_11----------------------#'
199 #########################################################################
200 # Check if tmp_table_size can be accessed with and without @@ sign #
201 #########################################################################
202
203 SET tmp_table_size = 1027;
204 SELECT @@tmp_table_size;
205
206 --Error ER_UNKNOWN_TABLE
207 SELECT local.tmp_table_size;
208
209 --Error ER_UNKNOWN_TABLE
210 SELECT global.tmp_table_size;
211
212 --Error ER_BAD_FIELD_ERROR
213 SELECT tmp_table_size = @@session.tmp_table_size;
214
215 ####################################
216 # Restore initial value #
217 ####################################
218
219 SET @@global.tmp_table_size = @start_global_value;
220 SET @@session.tmp_table_size = @start_session_value;
221
222 ###################################################
223 # END OF tmp_table_size TESTS #
224 ###################################################
225