1
############## mysql-test\t\max_error_count_basic.test ###############
3
# Variable Name: max_error_count #
4
# Scope: GLOBAL | SESSION #
5
# Access Type: Dynamic #
11
# Creation Date: 2008-02-07 #
14
# Description: Test Cases of Dynamic System Variable max_error_count #
15
# that checks the behavior of this variable in the following ways#
17
# * Valid & Invalid values #
18
# * Scope & Access method #
21
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
22
# server-system-variables.html #
24
###############################################################################
26
--source include/load_sysvars.inc
28
###############################################################
29
# START OF max_error_count TESTS #
30
###############################################################
33
#############################################################
34
# Save initial value #
35
#############################################################
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;
43
--echo '#--------------------FN_DYNVARS_076_01-------------------------#'
44
###############################################################
45
# Display the DEFAULT value of max_error_count #
46
###############################################################
48
SET @@global.max_error_count = 1000;
49
SET @@global.max_error_count = DEFAULT;
50
SELECT @@global.max_error_count;
52
SET @@session.max_error_count = 20000;
53
SET @@session.max_error_count = DEFAULT;
54
SELECT @@session.max_error_count;
57
--echo '#--------------------FN_DYNVARS_076_02-------------------------#'
58
##################################################################
59
# Check the DEFAULT value of max_error_count #
60
##################################################################
62
SET @@global.max_error_count = DEFAULT;
63
SELECT @@global.max_error_count = 64;
65
SET @@session.max_error_count = DEFAULT;
66
SELECT @@session.max_error_count = 64;
69
--echo '#--------------------FN_DYNVARS_076_03-------------------------#'
70
############################################################################
71
# Change the value of max_error_count to a valid value for GLOBAL Scope #
72
############################################################################
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
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
80
SET @@global.max_error_count = 65535;
81
SELECT @@global.max_error_count;
82
SET @@global.max_error_count = 65534;
83
SELECT @@global.max_error_count;
85
--echo '#--------------------FN_DYNVARS_076_04-------------------------#'
86
#############################################################################
87
# Change the value of max_error_count to a valid value for SESSION Scope #
88
#############################################################################
90
SET @@session.max_error_count = 0;
91
SELECT @@session.max_error_count;
92
SET @@session.max_error_count = 1;
93
SELECT @@session.max_error_count;
94
SET @@session.max_error_count = 65535;
95
SELECT @@session.max_error_count;
96
SET @@session.max_error_count = 65534;
97
SELECT @@session.max_error_count;
100
--echo '#------------------FN_DYNVARS_076_05-----------------------#'
101
##############################################################
102
# Change the value of max_error_count to an invalid value #
103
##############################################################
105
SET @@global.max_error_count = -1;
106
SELECT @@global.max_error_count;
107
SET @@global.max_error_count = -1024;
108
SELECT @@global.max_error_count;
109
SET @@global.max_error_count = 65536;
110
SELECT @@global.max_error_count;
111
SET @@global.max_error_count = 10737418241;
112
SELECT @@global.max_error_count;
113
--Error ER_PARSE_ERROR
114
SET @@global.max_error_count = 65530.34.;
115
SELECT @@global.max_error_count;
116
--Error ER_WRONG_TYPE_FOR_VAR
117
SET @@global.max_error_count = test;
118
SELECT @@global.max_error_count;
120
SET @@session.max_error_count = -1;
121
SELECT @@session.max_error_count;
122
SET @@session.max_error_count = 65536;
123
SELECT @@session.max_error_count;
124
SET @@session.max_error_count = -2;
125
SELECT @@session.max_error_count;
126
--Error ER_PARSE_ERROR
127
SET @@session.max_error_count = 65530.34.;
128
SET @@session.max_error_count = 10737418241;
129
SELECT @@session.max_error_count;
130
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
132
--Error ER_WRONG_TYPE_FOR_VAR
133
SET @@session.max_error_count = test;
134
SELECT @@session.max_error_count;
137
--echo '#------------------FN_DYNVARS_076_06-----------------------#'
138
####################################################################
139
# Check if the value in GLOBAL Table matches value in variable #
140
####################################################################
143
SELECT @@global.max_error_count = VARIABLE_VALUE
144
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
145
WHERE VARIABLE_NAME='max_error_count';
147
--echo '#------------------FN_DYNVARS_076_07-----------------------#'
148
####################################################################
149
# Check if the value in SESSION Table matches value in variable #
150
####################################################################
152
SELECT @@session.max_error_count = VARIABLE_VALUE
153
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
154
WHERE VARIABLE_NAME='max_error_count';
157
--echo '#------------------FN_DYNVARS_076_08-----------------------#'
158
####################################################################
159
# Check if TRUE and FALSE values can be used on variable #
160
####################################################################
162
SET @@global.max_error_count = TRUE;
163
SELECT @@global.max_error_count;
164
SET @@global.max_error_count = FALSE;
165
SELECT @@global.max_error_count;
168
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
169
#################################################################################
170
# Check if accessing variable with and without GLOBAL point to same variable #
171
#################################################################################
173
SET @@global.max_error_count = 2048;
174
SELECT @@max_error_count = @@global.max_error_count;
177
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
178
########################################################################################################
179
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
180
########################################################################################################
182
SET @@max_error_count = 60000;
183
SELECT @@max_error_count = @@local.max_error_count;
184
SELECT @@local.max_error_count = @@session.max_error_count;
187
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
188
#############################################################################
189
# Check if max_error_count can be accessed with and without @@ sign #
190
#############################################################################
192
SET max_error_count = 1024;
193
SELECT @@max_error_count;
194
--Error ER_UNKNOWN_TABLE
195
SELECT local.max_error_count;
196
--Error ER_UNKNOWN_TABLE
197
SELECT session.max_error_count;
198
--Error ER_BAD_FIELD_ERROR
199
SELECT max_error_count = @@session.max_error_count;
202
####################################
203
# Restore initial value #
204
####################################
206
SET @@global.max_error_count = @start_global_value;
207
SELECT @@global.max_error_count;
208
SET @@session.max_error_count = @start_session_value;
209
SELECT @@session.max_error_count;
212
#######################################################
213
# END OF max_error_count TESTS #
214
#######################################################