Debian Codegraph @

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

raw
1 ############## mysql-test\t\max_binlog_cache_size_basic.test ###############
2 # #
3 # Variable Name: max_binlog_cache_size #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value:4294967295 #
8 # Range: 4096-4294967295 #
9 # #
10 # #
11 # #
12 # #
13 # #
14 # Creation Date: 2008-02-07 #
15 # Author: Salman #
16 # #
17 # Description: Test Cases of Dynamic System Variable max_binlog_cache_size #
18 # that checks the behavior of this variable in the following ways#
19 # * Default Value #
20 # * Valid & Invalid values #
21 # * Scope & Access method #
22 # * Data Integrity #
23 # #
24 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
25 # server-system-variables.html #
26 # #
27 ###############################################################################
28
29 --source include/load_sysvars.inc
30
31 ########################################################################
32 # START OF max_binlog_cache_size TESTS #
33 ########################################################################
34
35
36 ########################################################################
37 # Saving initial value of max_binlog_cache_size in a temporary variable#
38 # We also save binlog_cache_size because its value cannot be greater #
39 # than max_binlog_cache_size. (BUG#55377) #
40 ########################################################################
41
42 SET @start_max_binlog_cache_size = @@global.max_binlog_cache_size;
43 SELECT @start_max_binlog_cache_size;
44 SET @start_binlog_cache_size = @@global.binlog_cache_size;
45 SELECT @start_binlog_cache_size;
46
47
48 --echo '#--------------------FN_DYNVARS_072_01------------------------#'
49 ########################################################################
50 # Display the DEFAULT value of max_binlog_cache_size #
51 ########################################################################
52
53 SET @@global.max_binlog_cache_size = 5000;
54 SET @@global.max_binlog_cache_size = DEFAULT;
55 SELECT @@global.max_binlog_cache_size;
56
57
58 --echo '#---------------------FN_DYNVARS_072_02-------------------------#'
59 ###############################################
60 # Verify default value of variable #
61 ###############################################
62
63 SET @@global.max_binlog_cache_size = @start_max_binlog_cache_size;
64 SELECT @@global.max_binlog_cache_size = 4294967295;
65
66 --echo '#--------------------FN_DYNVARS_072_03------------------------#'
67 ########################################################################
68 # Change the value of max_binlog_cache_size to a valid value #
69 ########################################################################
70
71 SET @@global.max_binlog_cache_size = 4096;
72 SELECT @@global.max_binlog_cache_size;
73 SET @@global.max_binlog_cache_size = 4294967295;
74 SELECT @@global.max_binlog_cache_size;
75 SET @@global.max_binlog_cache_size = 4294967294;
76 SELECT @@global.max_binlog_cache_size;
77 SET @@global.max_binlog_cache_size = 4097;
78 SELECT @@global.max_binlog_cache_size;
79 SET @@global.max_binlog_cache_size = 65535;
80 SELECT @@global.max_binlog_cache_size;
81
82
83 --echo '#--------------------FN_DYNVARS_072_04-------------------------#'
84 ###########################################################################
85 # Change the value of max_binlog_cache_size to invalid value #
86 ###########################################################################
87
88 SET @@global.max_binlog_cache_size = -1;
89 SELECT @@global.max_binlog_cache_size;
90 SET @@global.max_binlog_cache_size = 100000000000;
91 SELECT @@global.max_binlog_cache_size;
92 --Error ER_WRONG_TYPE_FOR_VAR
93 SET @@global.max_binlog_cache_size = 10000.01;
94 SELECT @@global.max_binlog_cache_size;
95 SET @@global.max_binlog_cache_size = -1024;
96 SELECT @@global.max_binlog_cache_size;
97 SET @@global.max_binlog_cache_size = 1024;
98 SELECT @@global.max_binlog_cache_size;
99 SET @@global.max_binlog_cache_size = 4294967296;
100 SELECT @@global.max_binlog_cache_size;
101 SET @@global.max_binlog_cache_size = 4095;
102 SELECT @@global.max_binlog_cache_size;
103
104 --Error ER_WRONG_TYPE_FOR_VAR
105 SET @@global.max_binlog_cache_size = ON;
106 SELECT @@global.max_binlog_cache_size;
107 --Error ER_WRONG_TYPE_FOR_VAR
108 SET @@global.max_binlog_cache_size = 'test';
109 SELECT @@global.max_binlog_cache_size;
110 --Error ER_WRONG_TYPE_FOR_VAR
111 SET @@global.max_binlog_cache_size = ' ';
112 SELECT @@global.max_binlog_cache_size;
113
114
115 --echo '#-------------------FN_DYNVARS_072_05----------------------------#'
116 ###########################################################################
117 # Test if accessing session max_binlog_cache_size gives error #
118 ###########################################################################
119
120 --Error ER_GLOBAL_VARIABLE
121 SET @@session.max_binlog_cache_size = 4096;
122 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
123 SELECT @@session.max_binlog_cache_size;
124
125
126 --echo '#----------------------FN_DYNVARS_072_06------------------------#'
127 ##############################################################################
128 # Check if the value in GLOBAL & SESSION Tables matches values in variable #
129 ##############################################################################
130
131 --disable_warnings
132 SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE
133 FROM performance_schema.global_variables
134 WHERE VARIABLE_NAME='max_binlog_cache_size';
135
136 SELECT @@max_binlog_cache_size = VARIABLE_VALUE
137 FROM performance_schema.session_variables
138 WHERE VARIABLE_NAME='max_binlog_cache_size';
139 --enable_warnings
140
141
142 --echo '#---------------------FN_DYNVARS_072_07----------------------#'
143 ###################################################################
144 # Check if TRUE and FALSE values can be used on variable #
145 ###################################################################
146
147 SET @@global.max_binlog_cache_size = TRUE;
148 SELECT @@global.max_binlog_cache_size;
149 SET @@global.max_binlog_cache_size = FALSE;
150 SELECT @@global.max_binlog_cache_size;
151
152
153 --echo '#---------------------FN_DYNVARS_072_08----------------------#'
154 ########################################################################################################
155 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
156 ########################################################################################################
157
158 SET @@global.max_binlog_cache_size = 5000;
159 SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
160
161
162 --echo '#---------------------FN_DYNVARS_072_09----------------------#'
163 ################################################################################
164 # Check if max_binlog_cache_size can be accessed with and without @@ sign #
165 ################################################################################
166
167 --Error ER_GLOBAL_VARIABLE
168 SET max_binlog_cache_size = 6000;
169 SELECT @@max_binlog_cache_size;
170 --Error ER_PARSE_ERROR
171 SET local.max_binlog_cache_size = 7000;
172 --Error ER_UNKNOWN_TABLE
173 SELECT local.max_binlog_cache_size;
174 --Error ER_PARSE_ERROR
175 SET global.max_binlog_cache_size = 8000;
176 --Error ER_UNKNOWN_TABLE
177 SELECT global.max_binlog_cache_size;
178 --Error ER_BAD_FIELD_ERROR
179 SELECT max_binlog_cache_size;
180 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
181 SELECT @@session.max_binlog_cache_size;
182
183
184 ##############################
185 # Restore initial value #
186 ##############################
187
188 SET @@global.max_binlog_cache_size = @start_max_binlog_cache_size;
189 SELECT @@global.max_binlog_cache_size;
190 SET @@global.binlog_cache_size= @start_binlog_cache_size;
191 SELECT @@global.binlog_cache_size;
192
193
194 ########################################################################
195 # END OF max_binlog_cache_size TESTS #
196 ########################################################################