~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/include/tmp_table_size_basic.inc

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
############## mysql-test\t\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: 33554432                                                     #
 
8
# Range: 1024-4294967295                                                      #
 
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
#                                                                             #
 
21
# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
 
22
#  server-system-variables.html#option_mysqld_tmp_table_size                  #
 
23
#                                                                             #
 
24
###############################################################################
 
25
 
 
26
--source include/load_sysvars.inc
 
27
 
 
28
##############################################################
 
29
#           START OF tmp_table_size TESTS                    #
 
30
##############################################################
 
31
 
 
32
 
 
33
#############################################################
 
34
#                 Save initial value                        #
 
35
#############################################################
 
36
 
 
37
SET @start_global_value = @@global.tmp_table_size;
 
38
SELECT @start_global_value;
 
39
SET @start_session_value = @@session.tmp_table_size;
 
40
SELECT @start_session_value;
 
41
 
 
42
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
 
43
 
 
44
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
 
45
##############################################################
 
46
#     Display the DEFAULT value of tmp_table_size            #
 
47
##############################################################
 
48
 
 
49
SET @@global.tmp_table_size = 100;
 
50
SET @@global.tmp_table_size = DEFAULT;
 
51
SELECT @@global.tmp_table_size;
 
52
 
 
53
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
 
54
SET @@session.tmp_table_size = 200;
 
55
SET @@session.tmp_table_size = DEFAULT;
 
56
SELECT @@session.tmp_table_size;
 
57
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
 
58
 
 
59
 
 
60
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
 
61
########################################################################
 
62
#     Check the DEFAULT value of tmp_table_size              #
 
63
########################################################################
 
64
 
 
65
SET @@global.tmp_table_size = DEFAULT;
 
66
SELECT @@global.tmp_table_size = 33554432;
 
67
 
 
68
SET @@session.tmp_table_size = DEFAULT;
 
69
SELECT @@session.tmp_table_size = 33554432;
 
70
 
 
71
--echo 'Bug# 34876: This variable has invalid default value as compared to documentation';
 
72
 
 
73
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
 
74
########################################################################
 
75
# Change the value of tmp_table_size to a valid value for GLOBAL Scope #
 
76
########################################################################
 
77
 
 
78
SET @@global.tmp_table_size = 1024;
 
79
SELECT @@global.tmp_table_size;
 
80
SET @@global.tmp_table_size = 60020;
 
81
SELECT @@global.tmp_table_size;
 
82
SET @@global.tmp_table_size = 4294967295;
 
83
SELECT @@global.tmp_table_size;
 
84
 
 
85
 
 
86
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
 
87
#########################################################################
 
88
# Change the value of tmp_table_size to a valid value for SESSION Scope #
 
89
#########################################################################
 
90
 
 
91
SET @@session.tmp_table_size = 1024;
 
92
SELECT @@session.tmp_table_size;
 
93
 
 
94
SET @@session.tmp_table_size =4294967295;
 
95
SELECT @@session.tmp_table_size;
 
96
SET @@session.tmp_table_size = 65535;
 
97
SELECT @@session.tmp_table_size;
 
98
 
 
99
 
 
100
--echo '#------------------FN_DYNVARS_005_05-----------------------#'
 
101
##########################################################
 
102
# Change the value of tmp_table_size to an invalid value #
 
103
##########################################################
 
104
 
 
105
SET @@global.tmp_table_size = 0;
 
106
SELECT @@global.tmp_table_size;
 
107
 
 
108
SET @@global.tmp_table_size = -1024;
 
109
SELECT @@global.tmp_table_size;
 
110
 
 
111
SET @@global.tmp_table_size = 1000;
 
112
SELECT @@global.tmp_table_size;
 
113
 
 
114
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
 
115
 
 
116
 
 
117
-- Error ER_WRONG_TYPE_FOR_VAR
 
118
SET @@global.tmp_table_size = ON;
 
119
 
 
120
 
 
121
-- Error ER_WRONG_TYPE_FOR_VAR
 
122
SET @@global.tmp_table_size = OFF;
 
123
 
 
124
 
 
125
SET @@global.tmp_table_size = True;
 
126
SELECT @@global.tmp_table_size;
 
127
 
 
128
SET @@global.tmp_table_size = False;
 
129
SELECT @@global.tmp_table_size;
 
130
--echo 'Bug:Error should be shown that variable is numeric and can not assigned boolean value';
 
131
 
 
132
 
 
133
-- Error ER_WRONG_TYPE_FOR_VAR
 
134
SET @@global.tmp_table_size = 65530.34;
 
135
 
 
136
-- Error ER_WRONG_TYPE_FOR_VAR
 
137
SET @@global.tmp_table_size ="Test";
 
138
 
 
139
 
 
140
-- Error ER_WRONG_TYPE_FOR_VAR
 
141
SET @@session.tmp_table_size = ON;
 
142
 
 
143
 
 
144
-- Error ER_WRONG_TYPE_FOR_VAR
 
145
SET @@session.tmp_table_size = OFF;
 
146
 
 
147
SET @@session.tmp_table_size = True;
 
148
SELECT @@session.tmp_table_size;
 
149
 
 
150
SET @@session.tmp_table_size = False;
 
151
SELECT @@session.tmp_table_size;
 
152
 
 
153
-- Error ER_WRONG_TYPE_FOR_VAR
 
154
SET @@session.tmp_table_size = "Test";
 
155
 
 
156
SET @@session.tmp_table_size = 12345678901;
 
157
SELECT @@session.tmp_table_size;
 
158
 
 
159
 
 
160
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
 
161
####################################################################
 
162
#   Check if the value in GLOBAL Table matches value in variable   #
 
163
####################################################################
 
164
 
 
165
 
 
166
SELECT @@global.tmp_table_size = VARIABLE_VALUE 
 
167
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 
168
WHERE VARIABLE_NAME='tmp_table_size';
 
169
 
 
170
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
 
171
####################################################################
 
172
#  Check if the value in SESSION Table matches value in variable   #
 
173
####################################################################
 
174
 
 
175
SELECT @@session.tmp_table_size = VARIABLE_VALUE 
 
176
FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 
177
WHERE VARIABLE_NAME='tmp_table_size';
 
178
 
 
179
 
 
180
 
 
181
 
 
182
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
 
183
########################################################################
 
184
#  Check if global and session variables are independent of each other #
 
185
########################################################################
 
186
 
 
187
SET @@global.tmp_table_size = 1024;
 
188
SET @@tmp_table_size = 4294967295;
 
189
SELECT @@tmp_table_size = @@global.tmp_table_size;
 
190
 
 
191
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
 
192
##################################################################
 
193
#    Check if accessing variable with SESSION,LOCAL and without  #
 
194
#    SCOPE points to same session variable                       #
 
195
##################################################################
 
196
 
 
197
SET @@tmp_table_size = 100;
 
198
SELECT @@tmp_table_size = @@local.tmp_table_size;
 
199
SELECT @@local.tmp_table_size = @@session.tmp_table_size;
 
200
 
 
201
 
 
202
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
 
203
#########################################################################
 
204
#   Check if tmp_table_size can be accessed with and without @@ sign    #
 
205
#########################################################################
 
206
 
 
207
SET tmp_table_size = 1027;
 
208
SELECT @@tmp_table_size;
 
209
 
 
210
--Error ER_UNKNOWN_TABLE
 
211
SELECT local.tmp_table_size;
 
212
 
 
213
--Error ER_UNKNOWN_TABLE
 
214
SELECT global.tmp_table_size;
 
215
 
 
216
--Error ER_BAD_FIELD_ERROR
 
217
SELECT tmp_table_size = @@session.tmp_table_size;
 
218
 
 
219
 
 
220
####################################
 
221
#     Restore initial value        #
 
222
####################################
 
223
 
 
224
SET @@global.tmp_table_size = @start_global_value;
 
225
SELECT @@global.tmp_table_size;
 
226
SET @@session.tmp_table_size = @start_session_value;
 
227
SELECT @@session.tmp_table_size;
 
228
 
 
229
 
 
230
###################################################
 
231
#                 END OF tmp_table_size TESTS     #
 
232
###################################################
 
233