~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/include/join_buffer_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\join_buffer_size_basic.test ###############
 
2
#                                                                             #
 
3
# Variable Name: join_buffer_size                                             #
 
4
# Scope: GLOBAL | SESSION                                                     #
 
5
# Access Type: Dynamic                                                        #
 
6
# Data Type: numeric                                                          #
 
7
# Default Value: 131072                                                       #
 
8
# Range: 8200-4294967295                                                      #
 
9
#                                                                             #
 
10
#                                                                             #
 
11
# Creation Date: 2008-02-07                                                   #
 
12
# Author:  Salman                                                             #
 
13
#                                                                             #
 
14
# Description: Test Cases of Dynamic System Variable join_buffer_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 join_buffer_size TESTS                    #
 
30
################################################################
 
31
 
 
32
 
 
33
#############################################################
 
34
#                 Save initial value                        #
 
35
#############################################################
 
36
 
 
37
SET @start_global_value = @@global.join_buffer_size;
 
38
SELECT @start_global_value;
 
39
SET @start_session_value = @@session.join_buffer_size;
 
40
SELECT @start_session_value;
 
41
 
 
42
 
 
43
--echo '#--------------------FN_DYNVARS_053_01-------------------------#'
 
44
################################################################
 
45
#     Display the DEFAULT value of join_buffer_size            #
 
46
################################################################
 
47
 
 
48
SET @@global.join_buffer_size = 8200;
 
49
SET @@global.join_buffer_size = DEFAULT;
 
50
SELECT @@global.join_buffer_size;
 
51
 
 
52
SET @@session.join_buffer_size = 8200;
 
53
SET @@session.join_buffer_size = DEFAULT;
 
54
SELECT @@session.join_buffer_size;
 
55
 
 
56
 
 
57
--echo '#--------------------FN_DYNVARS_053_02-------------------------#'
 
58
###################################################################
 
59
#     Check the DEFAULT value of join_buffer_size              #
 
60
###################################################################
 
61
 
 
62
SET @@global.join_buffer_size = DEFAULT;
 
63
SELECT @@global.join_buffer_size = 131072;
 
64
 
 
65
SET @@session.join_buffer_size = DEFAULT;
 
66
SELECT @@session.join_buffer_size = 131072;
 
67
 
 
68
 
 
69
--echo '#--------------------FN_DYNVARS_053_03-------------------------#'
 
70
##########################################################################
 
71
# Change the value of join_buffer_size to a valid value for GLOBAL Scope #
 
72
##########################################################################
 
73
 
 
74
SET @@global.join_buffer_size = 8200;
 
75
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
 
76
SET @@global.join_buffer_size = 65536;
 
77
SELECT @@global.join_buffer_size;
 
78
SET @@global.join_buffer_size = 4294967295;
 
79
SELECT @@global.join_buffer_size;
 
80
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
 
81
 
 
82
 
 
83
--echo '#--------------------FN_DYNVARS_053_04-------------------------#'
 
84
###########################################################################
 
85
# Change the value of join_buffer_size to a valid value for SESSION Scope #
 
86
###########################################################################
 
87
 
 
88
SET @@session.join_buffer_size = 8200;
 
89
SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
 
90
SET @@session.join_buffer_size = 65536;
 
91
SELECT @@session.join_buffer_size;
 
92
SET @@session.join_buffer_size = 4294967295;
 
93
SELECT @@session.join_buffer_size;
 
94
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
 
95
 
 
96
 
 
97
--echo '#------------------FN_DYNVARS_053_05-----------------------#'
 
98
############################################################
 
99
# Change the value of join_buffer_size to an invalid value #
 
100
############################################################
 
101
 
 
102
SET @@global.join_buffer_size = 0;
 
103
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
 
104
SET @@global.join_buffer_size = -1024;
 
105
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
 
106
SET @@global.join_buffer_size = 8199;
 
107
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
 
108
SET @@global.join_buffer_size = 42949672951;
 
109
SELECT @@global.join_buffer_size;
 
110
 
 
111
--Error ER_PARSE_ERROR
 
112
SET @@global.join_buffer_size = 65530.34.;
 
113
SELECT @@global.join_buffer_size;
 
114
--Error ER_WRONG_TYPE_FOR_VAR
 
115
SET @@global.join_buffer_size = test;
 
116
SELECT @@global.join_buffer_size;
 
117
 
 
118
SET @@session.join_buffer_size = 0;
 
119
SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
 
120
SET @@session.join_buffer_size = -2;
 
121
SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
 
122
SET @@session.join_buffer_size = 8199;
 
123
SELECT @@session.join_buffer_size=8200 OR @@session.join_buffer_size= 8228;
 
124
SET @@session.join_buffer_size = 42949672951;
 
125
SELECT @@session.join_buffer_size;
 
126
 
 
127
--Error ER_PARSE_ERROR
 
128
SET @@session.join_buffer_size = 65530.34.;
 
129
SELECT @@session.join_buffer_size;
 
130
echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
 
131
 
 
132
--Error ER_WRONG_TYPE_FOR_VAR
 
133
SET @@session.join_buffer_size = test;
 
134
SELECT @@session.join_buffer_size;
 
135
 
 
136
 
 
137
--echo '#------------------FN_DYNVARS_053_06-----------------------#'
 
138
####################################################################
 
139
#   Check if the value in GLOBAL Table matches value in variable   #
 
140
####################################################################
 
141
 
 
142
 
 
143
SELECT @@global.join_buffer_size = VARIABLE_VALUE 
 
144
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 
145
WHERE VARIABLE_NAME='join_buffer_size';
 
146
 
 
147
--echo '#------------------FN_DYNVARS_053_07-----------------------#'
 
148
####################################################################
 
149
#  Check if the value in SESSION Table matches value in variable   #
 
150
####################################################################
 
151
 
 
152
SELECT @@session.join_buffer_size = VARIABLE_VALUE 
 
153
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
 
154
WHERE VARIABLE_NAME='join_buffer_size';
 
155
 
 
156
 
 
157
--echo '#------------------FN_DYNVARS_053_08-----------------------#'
 
158
####################################################################
 
159
#     Check if TRUE and FALSE values can be used on variable       #
 
160
####################################################################
 
161
 
 
162
SET @@global.join_buffer_size = TRUE;
 
163
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
 
164
SET @@global.join_buffer_size = FALSE;
 
165
SELECT @@global.join_buffer_size=8200 OR @@global.join_buffer_size= 8228;
 
166
--echo 'Bug: Errors are not coming on assigning TRUE/FALSE to variable';
 
167
 
 
168
 
 
169
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
 
170
#################################################################################
 
171
#  Check if accessing variable with and without GLOBAL point to same variable   #
 
172
#################################################################################
 
173
 
 
174
SET @@global.join_buffer_size = 10;
 
175
SELECT @@join_buffer_size = @@global.join_buffer_size;
 
176
 
 
177
 
 
178
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
 
179
########################################################################################################
 
180
#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
 
181
########################################################################################################
 
182
 
 
183
SET @@join_buffer_size = 100;
 
184
SELECT @@join_buffer_size = @@local.join_buffer_size;
 
185
SELECT @@local.join_buffer_size = @@session.join_buffer_size;
 
186
 
 
187
 
 
188
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
 
189
##############################################################################
 
190
#   Check if join_buffer_size can be accessed with and without @@ sign    #
 
191
##############################################################################
 
192
 
 
193
SET join_buffer_size = 1;
 
194
SELECT @@join_buffer_size=8200 OR @@join_buffer_size= 8228;
 
195
--Error ER_UNKNOWN_TABLE
 
196
SELECT local.join_buffer_size;
 
197
--Error ER_UNKNOWN_TABLE
 
198
SELECT session.join_buffer_size;
 
199
--Error ER_BAD_FIELD_ERROR
 
200
SELECT join_buffer_size = @@session.join_buffer_size;
 
201
 
 
202
 
 
203
####################################
 
204
#     Restore initial value        #
 
205
####################################
 
206
 
 
207
SET @@global.join_buffer_size = @start_global_value;
 
208
SELECT @@global.join_buffer_size;
 
209
SET @@session.join_buffer_size = @start_session_value;
 
210
SELECT @@session.join_buffer_size;
 
211
 
 
212
 
 
213
########################################################
 
214
#                 END OF join_buffer_size TESTS     #
 
215
########################################################
 
216