1
########################### tmp_table_size_basic.test ##########################
3
# Variable Name: tmp_table_size #
4
# Scope: GLOBAL | SESSION #
5
# Access Type: Dynamic #
7
# Default Value: system dependend #
8
# Range: 1024-system dependend #
11
# Creation Date: 2008-02-13 #
14
# Description: Test Cases of Dynamic System Variable tmp_table_size #
15
# that checks the behavior of this variable in the following ways #
17
# * Valid & Invalid values #
18
# * Scope & Access method #
20
# Modified: 2008-12-04 HHunger #
21
# removed the differences between 64 and 32 bit platforms #
24
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html #
26
################################################################################
28
--source include/load_sysvars.inc
30
##############################################################
31
# START OF tmp_table_size TESTS #
32
##############################################################
34
#############################################################
35
# Save initial value #
36
#############################################################
38
SET @start_global_value = @@global.tmp_table_size;
39
SET @start_session_value = @@session.tmp_table_size;
41
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
42
##############################################################
43
# Display the DEFAULT value of tmp_table_size #
44
##############################################################
46
SET @@global.tmp_table_size = 100;
47
SET @@global.tmp_table_size = DEFAULT;
49
SET @@session.tmp_table_size = 200;
50
SET @@session.tmp_table_size = DEFAULT;
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;
60
SELECT @@session.tmp_table_size >= 16777216;
62
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
63
########################################################################
64
# Change the value of tmp_table_size to a valid value for GLOBAL Scope #
65
########################################################################
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;
75
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
76
#########################################################################
77
# Change the value of tmp_table_size to a valid value for SESSION Scope #
78
#########################################################################
80
SET @@session.tmp_table_size = 1024;
81
SELECT @@session.tmp_table_size;
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;
89
--echo '#------------------FN_DYNVARS_005_05-----------------------#'
90
##########################################################
91
# Change the value of tmp_table_size to an invalid value #
92
##########################################################
94
SET @@global.tmp_table_size = 0;
95
SELECT @@global.tmp_table_size;
97
SET @@global.tmp_table_size = -1024;
98
SELECT @@global.tmp_table_size;
100
SET @@global.tmp_table_size = 1000;
101
SELECT @@global.tmp_table_size;
103
--Error ER_WRONG_TYPE_FOR_VAR
104
SET @@global.tmp_table_size = ON;
106
--Error ER_WRONG_TYPE_FOR_VAR
107
SET @@global.tmp_table_size = OFF;
109
SET @@global.tmp_table_size = True;
110
SELECT @@global.tmp_table_size;
112
SET @@global.tmp_table_size = False;
113
SELECT @@global.tmp_table_size;
115
--Error ER_WRONG_TYPE_FOR_VAR
116
SET @@global.tmp_table_size = 65530.34;
118
--Error ER_WRONG_TYPE_FOR_VAR
119
SET @@global.tmp_table_size ="Test";
121
--Error ER_WRONG_TYPE_FOR_VAR
122
SET @@session.tmp_table_size = ON;
124
--Error ER_WRONG_TYPE_FOR_VAR
125
SET @@session.tmp_table_size = OFF;
127
SET @@session.tmp_table_size = True;
128
SELECT @@session.tmp_table_size;
130
SET @@session.tmp_table_size = False;
131
SELECT @@session.tmp_table_size;
133
--Error ER_WRONG_TYPE_FOR_VAR
134
SET @@session.tmp_table_size = "Test";
136
SET @@session.tmp_table_size = 12345678901;
138
# With a 64 bit mysqld:12345678901,with a 32 bit mysqld: 4294967295
139
SELECT @@session.tmp_table_size IN (12345678901,4294967295);
141
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
142
####################################################################
143
# Check if the value in GLOBAL Table matches value in variable #
144
####################################################################
146
SELECT @@global.tmp_table_size = VARIABLE_VALUE
147
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
148
WHERE VARIABLE_NAME='tmp_table_size';
150
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
151
####################################################################
152
# Check if the value in SESSION Table matches value in variable #
153
####################################################################
155
SELECT @@session.tmp_table_size = VARIABLE_VALUE
156
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
157
WHERE VARIABLE_NAME='tmp_table_size';
159
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
160
########################################################################
161
# Check if global and session variables are independent of each other #
162
########################################################################
164
SET @@global.tmp_table_size = 1024;
165
SET @@tmp_table_size = 4294967295;
166
SELECT @@tmp_table_size = @@global.tmp_table_size;
168
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
169
##################################################################
170
# Check if accessing variable with SESSION,LOCAL and without #
171
# SCOPE points to same session variable #
172
##################################################################
174
SET @@tmp_table_size = 100;
175
SELECT @@tmp_table_size = @@local.tmp_table_size;
176
SELECT @@local.tmp_table_size = @@session.tmp_table_size;
179
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
180
#########################################################################
181
# Check if tmp_table_size can be accessed with and without @@ sign #
182
#########################################################################
184
SET tmp_table_size = 1027;
185
SELECT @@tmp_table_size;
187
--Error ER_UNKNOWN_TABLE
188
SELECT local.tmp_table_size;
190
--Error ER_UNKNOWN_TABLE
191
SELECT global.tmp_table_size;
193
--Error ER_BAD_FIELD_ERROR
194
SELECT tmp_table_size = @@session.tmp_table_size;
196
####################################
197
# Restore initial value #
198
####################################
200
SET @@global.tmp_table_size = @start_global_value;
201
SET @@session.tmp_table_size = @start_session_value;
203
###################################################
204
# END OF tmp_table_size TESTS #
205
###################################################