~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/t/max_error_count_basic.test

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
 
79
 
 
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;
 
84
 
 
85
--echo '#--------------------FN_DYNVARS_076_04-------------------------#'
 
86
#############################################################################
 
87
# Change the value of max_error_count to a valid value for SESSION Scope #
 
88
#############################################################################
 
89
 
 
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;
 
98
 
 
99
 
 
100
--echo '#------------------FN_DYNVARS_076_05-----------------------#'
 
101
##############################################################
 
102
# Change the value of max_error_count to an invalid value #
 
103
##############################################################
 
104
 
 
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;
 
119
 
 
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';
 
131
 
 
132
--Error ER_WRONG_TYPE_FOR_VAR
 
133
SET @@session.max_error_count = test;
 
134
SELECT @@session.max_error_count;
 
135
 
 
136
 
 
137
--echo '#------------------FN_DYNVARS_076_06-----------------------#'
 
138
####################################################################
 
139
#   Check if the value in GLOBAL Table matches value in variable   #
 
140
####################################################################
 
141
 
 
142
 
 
143
SELECT @@global.max_error_count = VARIABLE_VALUE 
 
144
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 
145
WHERE VARIABLE_NAME='max_error_count';
 
146
 
 
147
--echo '#------------------FN_DYNVARS_076_07-----------------------#'
 
148
####################################################################
 
149
#  Check if the value in SESSION Table matches value in variable   #
 
150
####################################################################
 
151
 
 
152
SELECT @@session.max_error_count = VARIABLE_VALUE 
 
153
FROM INFORMATION_SCHEMA.SESSION_VARIABLES 
 
154
WHERE VARIABLE_NAME='max_error_count';
 
155
 
 
156
 
 
157
--echo '#------------------FN_DYNVARS_076_08-----------------------#'
 
158
####################################################################
 
159
#     Check if TRUE and FALSE values can be used on variable       #
 
160
####################################################################
 
161
 
 
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;
 
166
 
 
167
 
 
168
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
 
169
#################################################################################
 
170
#  Check if accessing variable with and without GLOBAL point to same variable   #
 
171
#################################################################################
 
172
 
 
173
SET @@global.max_error_count = 2048;
 
174
SELECT @@max_error_count = @@global.max_error_count;
 
175
 
 
176
 
 
177
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
 
178
########################################################################################################
 
179
#    Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable  #
 
180
########################################################################################################
 
181
 
 
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;
 
185
 
 
186
 
 
187
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
 
188
#############################################################################
 
189
#   Check if max_error_count can be accessed with and without @@ sign    #
 
190
#############################################################################
 
191
 
 
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;
 
200
 
 
201
 
 
202
####################################
 
203
#     Restore initial value        #
 
204
####################################
 
205
 
 
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;
 
210
 
 
211
 
 
212
#######################################################
 
213
#                 END OF max_error_count TESTS     #
 
214
#######################################################
 
215