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 ########################################################################
39
40 SET @start_value = @@global.max_binlog_cache_size;
41 --replace_result 18446744073709547520 max_binlog_cache_size 4294963200 max_binlog_cache_size
42 SELECT @start_value;
43
44
45 --echo '#--------------------FN_DYNVARS_072_01------------------------#'
46 ########################################################################
47 # Display the DEFAULT value of max_binlog_cache_size #
48 ########################################################################
49
50 SET @@global.max_binlog_cache_size = 5000;
51 SET @@global.max_binlog_cache_size = DEFAULT;
52 --replace_result 18446744073709547520 max_binlog_cache_size 4294963200 max_binlog_cache_size
53 SELECT @@global.max_binlog_cache_size;
54
55
56 --echo '#---------------------FN_DYNVARS_072_02-------------------------#'
57 ###############################################
58 # Verify default value of variable #
59 ###############################################
60
61 SET @@global.max_binlog_cache_size = @start_value;
62 SELECT @@global.max_binlog_cache_size = 4294967295;
63
64 --echo '#--------------------FN_DYNVARS_072_03------------------------#'
65 ########################################################################
66 # Change the value of max_binlog_cache_size to a valid value #
67 ########################################################################
68
69 SET @@global.max_binlog_cache_size = 4096;
70 SELECT @@global.max_binlog_cache_size;
71 SET @@global.max_binlog_cache_size = 4294967295;
72 SELECT @@global.max_binlog_cache_size;
73 SET @@global.max_binlog_cache_size = 4294967294;
74 SELECT @@global.max_binlog_cache_size;
75 SET @@global.max_binlog_cache_size = 4097;
76 SELECT @@global.max_binlog_cache_size;
77 SET @@global.max_binlog_cache_size = 65535;
78 SELECT @@global.max_binlog_cache_size;
79
80
81 --echo '#--------------------FN_DYNVARS_072_04-------------------------#'
82 ###########################################################################
83 # Change the value of max_binlog_cache_size to invalid value #
84 ###########################################################################
85
86 SET @@global.max_binlog_cache_size = -1;
87 SELECT @@global.max_binlog_cache_size;
88 SET @@global.max_binlog_cache_size = 100000000000;
89 --replace_result 99999997952 max_binlog_cache_size 4294963200 max_binlog_cache_size
90 SELECT @@global.max_binlog_cache_size;
91 SET @@global.max_binlog_cache_size = 1024*1024;
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 --disable_warnings
100 SET @@global.max_binlog_cache_size = 4294967296;
101 --enable_warnings
102 --replace_result 4294963200 max_binlog_cache_size 4294967296 max_binlog_cache_size
103 SELECT @@global.max_binlog_cache_size;
104 SET @@global.max_binlog_cache_size = 4095;
105 SELECT @@global.max_binlog_cache_size;
106
107 --Error ER_WRONG_TYPE_FOR_VAR
108 SET @@global.max_binlog_cache_size = ON;
109 SELECT @@global.max_binlog_cache_size;
110 --Error ER_WRONG_TYPE_FOR_VAR
111 SET @@global.max_binlog_cache_size = 'test';
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 SELECT @@global.max_binlog_cache_size = VARIABLE_VALUE
132 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
133 WHERE VARIABLE_NAME='max_binlog_cache_size';
134
135 SELECT @@max_binlog_cache_size = VARIABLE_VALUE
136 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
137 WHERE VARIABLE_NAME='max_binlog_cache_size';
138
139
140 --echo '#---------------------FN_DYNVARS_072_07----------------------#'
141 ###################################################################
142 # Check if TRUE and FALSE values can be used on variable #
143 ###################################################################
144
145 SET @@global.max_binlog_cache_size = TRUE;
146 SELECT @@global.max_binlog_cache_size;
147 SET @@global.max_binlog_cache_size = FALSE;
148 SELECT @@global.max_binlog_cache_size;
149
150
151 --echo '#---------------------FN_DYNVARS_072_08----------------------#'
152 ########################################################################################################
153 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
154 ########################################################################################################
155
156 SET @@global.max_binlog_cache_size = 5000;
157 SELECT @@max_binlog_cache_size = @@global.max_binlog_cache_size;
158
159
160 --echo '#---------------------FN_DYNVARS_072_09----------------------#'
161 ################################################################################
162 # Check if max_binlog_cache_size can be accessed with and without @@ sign #
163 ################################################################################
164
165 --Error ER_GLOBAL_VARIABLE
166 SET max_binlog_cache_size = 6000;
167 SELECT @@max_binlog_cache_size;
168 --Error ER_UNKNOWN_TABLE
169 SELECT local.max_binlog_cache_size;
170 --Error ER_UNKNOWN_TABLE
171 SELECT global.max_binlog_cache_size;
172 --Error ER_BAD_FIELD_ERROR
173 SELECT max_binlog_cache_size = @@session.max_binlog_cache_size;
174
175
176 ##############################
177 # Restore initial value #
178 ##############################
179
180 SET @@global.max_binlog_cache_size = @start_value;
181 --replace_result 4294963200 max_binlog_cache_size 18446744073709547520 max_binlog_cache_size
182 SELECT @@global.max_binlog_cache_size;
183
184
185 ########################################################################
186 # END OF max_binlog_cache_size TESTS #
187 ########################################################################