Debian Codegraph @

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

raw
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 SET @start_session_value = @@session.join_buffer_size;
39
40 --echo '#--------------------FN_DYNVARS_053_01-------------------------#'
41 ################################################################
42 # Display the DEFAULT value of join_buffer_size #
43 ################################################################
44
45 SET @@global.join_buffer_size = DEFAULT;
46 SELECT @@global.join_buffer_size > 0;
47
48 SET @@session.join_buffer_size = DEFAULT;
49 SELECT @@session.join_buffer_size > 0;
50
51
52 --echo '#--------------------FN_DYNVARS_053_03-------------------------#'
53 ##########################################################################
54 # Change the value of join_buffer_size to a valid value for GLOBAL Scope #
55 ##########################################################################
56
57 SET @@global.join_buffer_size = 8200;
58 SELECT @@global.join_buffer_size;
59 SET @@global.join_buffer_size = 65536;
60 SELECT @@global.join_buffer_size;
61 SET @@global.join_buffer_size = 4294967295;
62 SELECT @@global.join_buffer_size;
63
64 --echo '#--------------------FN_DYNVARS_053_04-------------------------#'
65 ###########################################################################
66 # Change the value of join_buffer_size to a valid value for SESSION Scope #
67 ###########################################################################
68
69 SET @@session.join_buffer_size = 8200;
70 SELECT @@session.join_buffer_size;
71 SET @@session.join_buffer_size = 65536;
72 SELECT @@session.join_buffer_size;
73 SET @@session.join_buffer_size = 4294967295;
74 SELECT @@session.join_buffer_size;
75
76 --echo '#------------------FN_DYNVARS_053_05-----------------------#'
77 ############################################################
78 # Change the value of join_buffer_size to an invalid value #
79 ############################################################
80
81 SET @@global.join_buffer_size = 0;
82 SELECT @@global.join_buffer_size;
83 SET @@global.join_buffer_size = -1024;
84 SELECT @@global.join_buffer_size;
85 SET @@global.join_buffer_size = 127;
86 SELECT @@global.join_buffer_size;
87 SET @@global.join_buffer_size = 42949672951;
88 --replace_result 42949672832 max_join_buffer_size 4294967168 max_join_buffer_size
89 SELECT @@global.join_buffer_size;
90 SET @@global.join_buffer_size = 1024*1024;
91
92 --Error ER_WRONG_TYPE_FOR_VAR
93 SET @@global.join_buffer_size = 65530.34;
94 SELECT @@global.join_buffer_size;
95 --Error ER_WRONG_TYPE_FOR_VAR
96 SET @@global.join_buffer_size = test;
97 SELECT @@global.join_buffer_size;
98
99 SET @@session.join_buffer_size = 0;
100 SELECT @@session.join_buffer_size;
101 SET @@session.join_buffer_size = -1024;
102 SELECT @@session.join_buffer_size;
103 SET @@session.join_buffer_size = 127;
104 SELECT @@session.join_buffer_size;
105 SET @@session.join_buffer_size = 42949672951;
106 --replace_result 42949672832 max_join_buffer_size 4294967168 max_join_buffer_size
107 SELECT @@session.join_buffer_size;
108 SET @@session.join_buffer_size = 1024*1024;
109
110 --Error ER_WRONG_TYPE_FOR_VAR
111 SET @@session.join_buffer_size = 65530.34;
112 SELECT @@session.join_buffer_size;
113
114 --Error ER_WRONG_TYPE_FOR_VAR
115 SET @@session.join_buffer_size = test;
116 SELECT @@session.join_buffer_size;
117
118 --echo '#------------------FN_DYNVARS_053_06-----------------------#'
119 ####################################################################
120 # Check if the value in GLOBAL Table matches value in variable #
121 ####################################################################
122
123
124 SELECT @@global.join_buffer_size = VARIABLE_VALUE
125 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
126 WHERE VARIABLE_NAME='join_buffer_size';
127
128 --echo '#------------------FN_DYNVARS_053_07-----------------------#'
129 ####################################################################
130 # Check if the value in SESSION Table matches value in variable #
131 ####################################################################
132
133 SELECT @@session.join_buffer_size = VARIABLE_VALUE
134 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
135 WHERE VARIABLE_NAME='join_buffer_size';
136
137
138 --echo '#------------------FN_DYNVARS_053_08-----------------------#'
139 ####################################################################
140 # Check if TRUE and FALSE values can be used on variable #
141 ####################################################################
142
143 SET @@global.join_buffer_size = TRUE;
144 SET @@global.join_buffer_size = FALSE;
145
146 --echo '#---------------------FN_DYNVARS_001_09----------------------#'
147 #################################################################################
148 # Check if accessing variable with and without GLOBAL point to same variable #
149 #################################################################################
150
151 SET @@global.join_buffer_size = 10;
152 SELECT @@join_buffer_size = @@global.join_buffer_size;
153
154 --echo '#---------------------FN_DYNVARS_001_10----------------------#'
155 ########################################################################################################
156 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
157 ########################################################################################################
158
159 SET @@join_buffer_size = 100;
160 SELECT @@join_buffer_size = @@local.join_buffer_size;
161 SELECT @@local.join_buffer_size = @@session.join_buffer_size;
162
163 --echo '#---------------------FN_DYNVARS_001_11----------------------#'
164 ##############################################################################
165 # Check if join_buffer_size can be accessed with and without @@ sign #
166 ##############################################################################
167
168 SET join_buffer_size = 1;
169 SELECT @@join_buffer_size;
170 --Error ER_UNKNOWN_TABLE
171 SELECT local.join_buffer_size;
172 --Error ER_UNKNOWN_TABLE
173 SELECT session.join_buffer_size;
174 --Error ER_BAD_FIELD_ERROR
175 SELECT join_buffer_size = @@session.join_buffer_size;
176
177 ####################################
178 # Restore initial value #
179 ####################################
180
181 SET @@global.join_buffer_size = @start_global_value;
182 SET @@session.join_buffer_size = @start_session_value;
183
184 ########################################################
185 # END OF join_buffer_size TESTS #
186 ########################################################
187