Debian Codegraph @

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

raw
1 ############## mysql-test\t\max_error_count_basic.test ###############
2 # #
3 # Variable Name: max_error_count #
4 # Scope: GLOBAL | SESSION #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: 64 #
8 # Range: 0-65535 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman #
13 # #
14 # Description: Test Cases of Dynamic System Variable max_error_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 # 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 max_error_count TESTS #
30 ###############################################################
31
32
33 #############################################################
34 # Save initial value #
35 #############################################################
36
37 SET @start_global_value = @@global.max_error_count;
38 SELECT @start_global_value;
39 SET @start_session_value = @@session.max_error_count;
40 SELECT @start_session_value;
41
42
43 --echo '#--------------------FN_DYNVARS_076_01-------------------------#'
44 ###############################################################
45 # Display the DEFAULT value of max_error_count #
46 ###############################################################
47
48 SET @@global.max_error_count = 1000;
49 SET @@global.max_error_count = DEFAULT;
50 SELECT @@global.max_error_count;
51
52 SET @@session.max_error_count = 20000;
53 SET @@session.max_error_count = DEFAULT;
54 SELECT @@session.max_error_count;
55
56
57 --echo '#--------------------FN_DYNVARS_076_02-------------------------#'
58 ##################################################################
59 # Check the DEFAULT value of max_error_count #
60 ##################################################################
61
62 SET @@global.max_error_count = DEFAULT;
63 SELECT @@global.max_error_count = 64;
64
65 SET @@session.max_error_count = DEFAULT;
66 SELECT @@session.max_error_count = 64;
67
68
69 --echo '#--------------------FN_DYNVARS_076_03-------------------------#'
70 ############################################################################
71 # Change the value of max_error_count to a valid value for GLOBAL Scope #
72 ############################################################################
73
74 SET @@global.max_error_count = 1;
75 SELECT @@global.max_error_count;
76 SET @@global.max_error_count = 0;
77 SELECT @@global.max_error_count;
78
79 SET @@global.max_error_count = 65535;
80 SELECT @@global.max_error_count;
81 SET @@global.max_error_count = 65534;
82 SELECT @@global.max_error_count;
83
84 --echo '#--------------------FN_DYNVARS_076_04-------------------------#'
85 #############################################################################
86 # Change the value of max_error_count to a valid value for SESSION Scope #
87 #############################################################################
88
89 SET @@session.max_error_count = 0;
90 SELECT @@session.max_error_count;
91 SET @@session.max_error_count = 1;
92 SELECT @@session.max_error_count;
93 SET @@session.max_error_count = 65535;
94 SELECT @@session.max_error_count;
95 SET @@session.max_error_count = 65534;
96 SELECT @@session.max_error_count;
97
98
99 --echo '#------------------FN_DYNVARS_076_05-----------------------#'
100 ##############################################################
101 # Change the value of max_error_count to an invalid value #
102 ##############################################################
103
104 SET @@global.max_error_count = -1;
105 SELECT @@global.max_error_count;
106 SET @@global.max_error_count = -1024;
107 SELECT @@global.max_error_count;
108 SET @@global.max_error_count = 65536;
109 SELECT @@global.max_error_count;
110 SET @@global.max_error_count = 10737418241;
111 SELECT @@global.max_error_count;
112 --Error ER_WRONG_TYPE_FOR_VAR
113 SET @@global.max_error_count = 65530.34;
114 SELECT @@global.max_error_count;
115 --Error ER_WRONG_TYPE_FOR_VAR
116 SET @@global.max_error_count = test;
117 SELECT @@global.max_error_count;
118
119 SET @@session.max_error_count = -1;
120 SELECT @@session.max_error_count;
121 SET @@session.max_error_count = 65536;
122 SELECT @@session.max_error_count;
123 SET @@session.max_error_count = -2;
124 SELECT @@session.max_error_count;
125 --Error ER_WRONG_TYPE_FOR_VAR
126 SET @@session.max_error_count = 65530.34;
127 SET @@session.max_error_count = 10737418241;
128 SELECT @@session.max_error_count;
129
130 --Error ER_WRONG_TYPE_FOR_VAR
131 SET @@session.max_error_count = test;
132 SELECT @@session.max_error_count;
133
134
135 --echo '#------------------FN_DYNVARS_076_06-----------------------#'
136 ####################################################################
137 # Check if the value in GLOBAL Table matches value in variable #
138 ####################################################################
139
140
141 SELECT @@global.max_error_count = VARIABLE_VALUE
142 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
143 WHERE VARIABLE_NAME='max_error_count';
144
145 --echo '#------------------FN_DYNVARS_076_07-----------------------#'
146 ####################################################################
147 # Check if the value in SESSION Table matches value in variable #
148 ####################################################################
149
150 SELECT @@session.max_error_count = VARIABLE_VALUE
151 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
152 WHERE VARIABLE_NAME='max_error_count';
153
154
155 --echo '#------------------FN_DYNVARS_076_08-----------------------#'
156 ####################################################################
157 # Check if TRUE and FALSE values can be used on variable #
158 ####################################################################
159
160 SET @@global.max_error_count = TRUE;
161 SELECT @@global.max_error_count;
162 SET @@global.max_error_count = FALSE;
163 SELECT @@global.max_error_count;
164
165
166 --echo '#---------------------FN_DYNVARS_001_09----------------------#'
167 #################################################################################
168 # Check if accessing variable with and without GLOBAL point to same variable #
169 #################################################################################
170
171 SET @@global.max_error_count = 2048;
172 SELECT @@max_error_count = @@global.max_error_count;
173
174
175 --echo '#---------------------FN_DYNVARS_001_10----------------------#'
176 ########################################################################################################
177 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
178 ########################################################################################################
179
180 SET @@max_error_count = 60000;
181 SELECT @@max_error_count = @@local.max_error_count;
182 SELECT @@local.max_error_count = @@session.max_error_count;
183
184
185 --echo '#---------------------FN_DYNVARS_001_11----------------------#'
186 #############################################################################
187 # Check if max_error_count can be accessed with and without @@ sign #
188 #############################################################################
189
190 SET max_error_count = 1024;
191 SELECT @@max_error_count;
192 --Error ER_UNKNOWN_TABLE
193 SELECT local.max_error_count;
194 --Error ER_UNKNOWN_TABLE
195 SELECT session.max_error_count;
196 --Error ER_BAD_FIELD_ERROR
197 SELECT max_error_count = @@session.max_error_count;
198
199
200 ####################################
201 # Restore initial value #
202 ####################################
203
204 SET @@global.max_error_count = @start_global_value;
205 SELECT @@global.max_error_count;
206 SET @@session.max_error_count = @start_session_value;
207 SELECT @@session.max_error_count;
208
209
210 #######################################################
211 # END OF max_error_count TESTS #
212 #######################################################
213