Debian Codegraph @

mysql-test/suite/sys_vars/inc/max_write_lock_count_basic.inc

raw
1 ################# mysql-test\t\max_write_lock_count_basic.test ##################
2 # #
3 # Variable Name: max_write_lock_count #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: 4294967295/18446744073709551615 #
8 # Range: 1 - 4294967295/18446744073709551615 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman #
13 # #
14 # Description: Test Cases of Dynamic System Variable max_write_lock_count #
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 # Modified: Pavan Naik, 2015-11-24 #
22 # Added boundary value test cases according to the type of the #
23 # server binary. #
24 # #
25 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
26 # server-system-variables.html #
27 # #
28 #################################################################################
29
30 --source include/load_sysvars.inc
31
32 ##########################################
33 # START OF max_write_lock_count TESTS #
34 ##########################################
35
36
37 #############################################################
38 # Save initial value #
39 #############################################################
40
41 SET @start_global_value = @@global.max_write_lock_count;
42
43 if($mach64)
44 {
45 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
46 let $machine_name = `SELECT CONVERT(@@version_compile_os using latin1) IN ("Win64", "Windows")`;
47
48 if($machine_name)
49 {
50 --replace_result 4294967295 18446744073709551615
51 }
52 }
53 SELECT @start_global_value;
54
55
56 --echo '#--------------------FN_DYNVARS_088_01-------------------------#'
57 ############################################################
58 # Display the DEFAULT value of max_write_lock_count #
59 ############################################################
60
61 SET @@global.max_write_lock_count = 1000;
62 SET @@global.max_write_lock_count = DEFAULT;
63
64 if($mach64)
65 {
66 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
67 if($machine_name)
68 {
69 --replace_result 4294967295 18446744073709551615
70 }
71 }
72 SELECT @@global.max_write_lock_count;
73
74
75 --echo '#--------------------FN_DYNVARS_088_02-------------------------#'
76 ############################################################
77 # Check the DEFAULT value of max_write_lock_count #
78 ############################################################
79
80 SET @@global.max_write_lock_count = DEFAULT;
81
82 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
83 if($mach64)
84 {
85 if($machine_name)
86 {
87 --replace_result 1 0
88 }
89 }
90 SELECT @@global.max_write_lock_count = 4294967295;
91
92
93 --echo '#--------------------FN_DYNVARS_088_03-------------------------#'
94 ##############################################################################
95 # Change the value of max_write_lock_count to a valid value for GLOBAL Scope #
96 ##############################################################################
97
98 SET @@global.max_write_lock_count = 1;
99 SELECT @@global.max_write_lock_count;
100 SET @@global.max_write_lock_count = 2;
101 SELECT @@global.max_write_lock_count;
102 SET @@global.max_write_lock_count = 65536;
103 SELECT @@global.max_write_lock_count;
104 SET @@global.max_write_lock_count = 4294967295;
105 SELECT @@global.max_write_lock_count;
106 SET @@global.max_write_lock_count = 4294967294;
107 SELECT @@global.max_write_lock_count;
108
109 # Test cases for 64-bit machines
110 if($mach64)
111 {
112 --disable_warnings
113 SET @@global.max_write_lock_count = 18446744073709551615;
114 --enable_warnings
115
116 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
117 if($machine_name)
118 {
119 --replace_result 4294967295 18446744073709551615
120 }
121 SELECT @@global.max_write_lock_count;
122 }
123
124
125 --echo '#------------------FN_DYNVARS_088_04-----------------------#'
126 ################################################################
127 # Change the value of max_write_lock_count to an invalid value #
128 ################################################################
129
130 SET @@global.max_write_lock_count = -1024;
131 SELECT @@global.max_write_lock_count;
132 SET @@global.max_write_lock_count = -1;
133 SELECT @@global.max_write_lock_count;
134 --Error ER_WRONG_TYPE_FOR_VAR
135 SET @@global.max_write_lock_count = 65530.34;
136 SELECT @@global.max_write_lock_count;
137 --Error ER_WRONG_TYPE_FOR_VAR
138 SET @@global.max_write_lock_count = test;
139 SELECT @@global.max_write_lock_count;
140
141 if($mach32)
142 {
143 SET @@global.max_write_lock_count = 4294967296;
144 SELECT @@global.max_write_lock_count;
145
146 SET @@global.max_write_lock_count = 42949672950;
147 SELECT @@global.max_write_lock_count;
148 }
149
150 if($mach64)
151 {
152 --error ER_WRONG_TYPE_FOR_VAR
153 SET @@global.max_write_lock_count = 18446744073709551616;
154 SELECT @@global.max_write_lock_count;
155 }
156
157
158 --echo '#------------------FN_DYNVARS_088_05-----------------------#'
159 ####################################################################
160 # Check if the value in GLOBAL Table matches value in variable #
161 ####################################################################
162
163 --disable_warnings
164 SELECT @@global.max_write_lock_count = VARIABLE_VALUE
165 FROM performance_schema.global_variables
166 WHERE VARIABLE_NAME='max_write_lock_count';
167 --enable_warnings
168
169 --echo '#------------------FN_DYNVARS_088_06-----------------------#'
170 ####################################################################
171 # Check if TRUE and FALSE values can be used on variable #
172 ####################################################################
173
174 SET @@global.max_write_lock_count = TRUE;
175 SELECT @@global.max_write_lock_count;
176 SET @@global.max_write_lock_count = FALSE;
177 SELECT @@global.max_write_lock_count;
178
179
180 --echo '#---------------------FN_DYNVARS_088_07----------------------#'
181 #################################################################################
182 # Check if accessing variable with and without GLOBAL point to same variable #
183 #################################################################################
184
185 SET @@global.max_write_lock_count = 20;
186 SELECT @@max_write_lock_count = @@global.max_write_lock_count;
187
188
189 --echo '#---------------------FN_DYNVARS_088_08----------------------#'
190 ###############################################################################
191 # Check if max_write_lock_count can be accessed with and without @@ sign #
192 ###############################################################################
193
194
195 SET @@global.max_write_lock_count = 102;
196 SELECT @@max_write_lock_count;
197 --Error ER_UNKNOWN_TABLE
198 SELECT local.max_write_lock_count;
199 --Error ER_UNKNOWN_TABLE
200 SELECT global.max_write_lock_count;
201 --Error ER_BAD_FIELD_ERROR
202 SELECT max_write_lock_count = @@global.max_write_lock_count;
203
204
205 ####################################
206 # Restore initial value #
207 ####################################
208
209 SET @@global.max_write_lock_count = @start_global_value;
210
211 if($mach64)
212 {
213 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
214 if($machine_name)
215 {
216 --replace_result 4294967295 18446744073709551615
217 }
218 }
219 SELECT @@global.max_write_lock_count;
220
221
222 ###################################################
223 # END OF max_write_lock_count TESTS #
224 ###################################################
225