Debian Codegraph @

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

raw
1 ############### mysql-test\t\delayed_insert_limit_basic.test ###################
2 # #
3 # Variable Name: delayed_insert_limit #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: Numeric #
7 # Default Value: 100 #
8 # Range: 1 - 4294967295/18446744073709551615 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman Rawala #
13 # #
14 # Description: Test Cases of Dynamic System Variable "delayed_insert_limit" #
15 # that checks 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#option_mysqld_delayed_insert_limit #
27 # #
28 ################################################################################
29
30 --source include/load_sysvars.inc
31
32 #################################################################
33 # START OF delayed_insert_limit TESTS #
34 #################################################################
35
36 #########################################################################
37 # Saving initial value of delayed_insert_limit in a temporary variable #
38 #########################################################################
39
40 SET @start_value = @@global.delayed_insert_limit;
41 SELECT @start_value;
42
43 --echo '#--------------------FN_DYNVARS_024_01------------------------#'
44 #########################################################################
45 # Display the DEFAULT value of delayed_insert_limit #
46 #########################################################################
47
48 SET @@global.delayed_insert_limit = 100;
49 SET @@global.delayed_insert_limit = DEFAULT;
50 SELECT @@global.delayed_insert_limit;
51
52
53 --echo '#---------------------FN_DYNVARS_024_02-------------------------#'
54 ###############################################
55 # Verify default value of variable #
56 ###############################################
57
58 SET @@global.delayed_insert_limit = @start_value;
59 SELECT @@global.delayed_insert_limit = 100;
60
61
62 --echo '#--------------------FN_DYNVARS_024_03------------------------#'
63 #########################################################################
64 # Change the value of delayed_insert_limit to a valid value #
65 #########################################################################
66
67 SET @@global.delayed_insert_limit = 1;
68 SELECT @@global.delayed_insert_limit;
69 SET @@global.delayed_insert_limit = 10000;
70 SELECT @@global.delayed_insert_limit;
71 SET @@global.delayed_insert_limit = 4294967295;
72 SELECT @@global.delayed_insert_limit;
73 SET @@global.delayed_insert_limit = 1;
74 SELECT @@global.delayed_insert_limit;
75
76 # Test cases for 64-bit machines
77 if($mach64)
78 {
79 --disable_warnings
80 SET @@global.delayed_insert_limit = 18446744073709551615;
81 --enable_warnings
82
83 # Bug#11752618 - 64-BIT WINDOWS VARIABLES LIMITED TO DIFFERENT VALUES THAN 64-BIT LINUX/SO
84 let $machine_name = `SELECT CONVERT(@@version_compile_os using latin1) IN ("Win64", "Windows")`;
85
86 if($machine_name)
87 {
88 --replace_result 4294967295 18446744073709551615
89 }
90 SELECT @@global.delayed_insert_limit;
91 }
92
93 --echo '#--------------------FN_DYNVARS_024_04-------------------------#'
94 ############################################################################
95 # Change the value of delayed_insert_limit to invalid value #
96 ############################################################################
97
98 SET @@global.delayed_insert_limit = 0;
99 SELECT @@global.delayed_insert_limit;
100 SET @@global.delayed_insert_limit = -1024;
101 SELECT @@global.delayed_insert_limit;
102
103 --Error ER_WRONG_TYPE_FOR_VAR
104 SET @@global.delayed_insert_limit = 429496729.5;
105 SELECT @@global.delayed_insert_limit;
106 --Error ER_WRONG_TYPE_FOR_VAR
107 SET @@global.delayed_insert_limit = ON;
108 SELECT @@global.delayed_insert_limit;
109
110 if($mach32)
111 {
112 SET @@global.delayed_insert_limit = 4294967296;
113 SELECT @@global.delayed_insert_limit;
114
115 SET @@global.delayed_insert_limit = 42949672950;
116 SELECT @@global.delayed_insert_limit;
117 }
118
119 if($mach64)
120 {
121 --error ER_WRONG_TYPE_FOR_VAR
122 SET @@global.delayed_insert_limit = 18446744073709551616;
123 SELECT @@global.delayed_insert_limit;
124 }
125
126 --echo '#-------------------FN_DYNVARS_024_05----------------------------#'
127 ############################################################################
128 # Test if accessing session delayed_insert_limit gives error #
129 ############################################################################
130
131 --Error ER_GLOBAL_VARIABLE
132 SET @@session.delayed_insert_limit = 0;
133 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
134 SELECT @@Session.delayed_insert_limit;
135
136
137 --echo '#----------------------FN_DYNVARS_024_06------------------------#'
138 ##############################################################################
139 # Check if the value in GLOBAL & SESSION Tables matches values in variable #
140 ##############################################################################
141
142 --disable_warnings
143 SELECT VARIABLE_VALUE FROM performance_schema.global_variables
144 WHERE VARIABLE_NAME='delayed_insert_limit'
145 into @tmp;
146 --enable_warnings
147
148 SELECT @@global.delayed_insert_limit = @tmp;
149
150 --disable_warnings
151 SELECT VARIABLE_VALUE FROM performance_schema.session_variables
152 WHERE VARIABLE_NAME='delayed_insert_limit'
153 into @tmp;
154 --enable_warnings
155
156 SELECT @@delayed_insert_limit = @tmp;
157
158
159 --echo '#---------------------FN_DYNVARS_024_07----------------------#'
160 ###################################################################
161 # Check if TRUE and FALSE values can be used on variable #
162 ###################################################################
163
164 SET @@global.delayed_insert_limit = TRUE;
165 SELECT @@global.delayed_insert_limit;
166 SET @@global.delayed_insert_limit = FALSE;
167 SELECT @@global.delayed_insert_limit;
168
169 --echo '#---------------------FN_DYNVARS_024_08----------------------#'
170 ########################################################################################################
171 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
172 ########################################################################################################
173
174 SET @@global.delayed_insert_limit = 1;
175 SELECT @@delayed_insert_limit = @@global.delayed_insert_limit;
176
177
178 --echo '#---------------------FN_DYNVARS_024_09----------------------#'
179 ##############################################################################
180 # Check if delayed_insert_limit can be accessed with and without @@ sign #
181 ##############################################################################
182
183 --Error ER_GLOBAL_VARIABLE
184 SET delayed_insert_limit = 1;
185 SELECT @@delayed_insert_limit;
186 --Error ER_PARSE_ERROR
187 SET local.delayed_insert_limit = 1;
188 --Error ER_UNKNOWN_TABLE
189 SELECT local.delayed_insert_limit;
190 --Error ER_PARSE_ERROR
191 SET global.delayed_insert_limit = 1;
192 --Error ER_UNKNOWN_TABLE
193 SELECT global.delayed_insert_limit;
194 --Error ER_BAD_FIELD_ERROR
195 SELECT delayed_insert_limit;
196 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
197 SELECT @@session.delayed_insert_limit;
198
199 ##############################
200 # Restore initial value #
201 ##############################
202
203 SET @@global.delayed_insert_limit = @start_value;
204 SELECT @@global.delayed_insert_limit;
205
206
207 ###########################################################
208 # END OF delayed_insert_limit TESTS #
209 ###########################################################
210