Debian Codegraph @

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

raw
1 ############## mysql-test\t\max_connect_errors_basic.test ###############
2 # #
3 # Variable Name: max_connect_errors #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: 10 #
8 # Range: 1-4294967295 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman #
13 # #
14 # Description: Test Cases of Dynamic System Variable max_connect_errors #
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_connect_errors TESTS #
30 ##################################################################
31
32
33 ######################################################################
34 # Saving initial value of max_connect_errors in a temporary variable #
35 ######################################################################
36
37 SET @start_value = @@global.max_connect_errors;
38 SELECT @start_value >= 0;
39
40
41 --echo '#--------------------FN_DYNVARS_073_01------------------------#'
42 ##################################################################
43 # Display the DEFAULT value of max_connect_errors #
44 ##################################################################
45
46 SET @@global.max_connect_errors = 5000;
47 SET @@global.max_connect_errors = DEFAULT;
48
49 --echo '#---------------------FN_DYNVARS_073_02-------------------------#'
50 ###############################################
51 # Verify default value of variable #
52 ###############################################
53
54 SET @@global.max_connect_errors = @start_value;
55 SELECT @@global.max_connect_errors = @start_value;
56
57 --echo '#--------------------FN_DYNVARS_073_03------------------------#'
58 ##################################################################
59 # Change the value of max_connect_errors to a valid value #
60 ##################################################################
61
62 SET @@global.max_connect_errors = 4096;
63 SELECT @@global.max_connect_errors;
64 SET @@global.max_connect_errors = 4294967294;
65 SELECT @@global.max_connect_errors;
66 SET @@global.max_connect_errors = 4294967295;
67 SELECT @@global.max_connect_errors;
68 SET @@global.max_connect_errors = 1;
69 SELECT @@global.max_connect_errors;
70 SET @@global.max_connect_errors = 2;
71 SELECT @@global.max_connect_errors;
72
73
74 --echo '#--------------------FN_DYNVARS_073_04-------------------------#'
75 #####################################################################
76 # Change the value of max_connect_errors to invalid value #
77 #####################################################################
78
79 SET @@global.max_connect_errors = -1;
80 SELECT @@global.max_connect_errors;
81 SET @@global.max_connect_errors = 100000000000;
82 SELECT @@global.max_connect_errors;
83 --Error ER_WRONG_TYPE_FOR_VAR
84 SET @@global.max_connect_errors = 10000.01;
85 SELECT @@global.max_connect_errors;
86 SET @@global.max_connect_errors = -1024;
87 SELECT @@global.max_connect_errors;
88 SET @@global.max_connect_errors = 0;
89 SELECT @@global.max_connect_errors;
90 SET @@global.max_connect_errors = 4294967296;
91 SELECT @@global.max_connect_errors;
92
93 --Error ER_WRONG_TYPE_FOR_VAR
94 SET @@global.max_connect_errors = ON;
95 SELECT @@global.max_connect_errors;
96 --Error ER_WRONG_TYPE_FOR_VAR
97 SET @@global.max_connect_errors = 'test';
98 SELECT @@global.max_connect_errors;
99
100
101 --echo '#-------------------FN_DYNVARS_073_05----------------------------#'
102 #####################################################################
103 # Test if accessing session max_connect_errors gives error #
104 #####################################################################
105
106 --Error ER_GLOBAL_VARIABLE
107 SET @@session.max_connect_errors = 4096;
108 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
109 SELECT @@session.max_connect_errors;
110
111
112 --echo '#----------------------FN_DYNVARS_073_06------------------------#'
113 ##############################################################################
114 # Check if the value in GLOBAL & SESSION Tables matches values in variable #
115 ##############################################################################
116
117 SELECT @@global.max_connect_errors = VARIABLE_VALUE
118 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
119 WHERE VARIABLE_NAME='max_connect_errors';
120
121 SELECT @@max_connect_errors = VARIABLE_VALUE
122 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
123 WHERE VARIABLE_NAME='max_connect_errors';
124
125
126 --echo '#---------------------FN_DYNVARS_073_07----------------------#'
127 ###################################################################
128 # Check if TRUE and FALSE values can be used on variable #
129 ###################################################################
130
131 SET @@global.max_connect_errors = TRUE;
132 SELECT @@global.max_connect_errors;
133 SET @@global.max_connect_errors = FALSE;
134 SELECT @@global.max_connect_errors;
135
136
137 --echo '#---------------------FN_DYNVARS_073_08----------------------#'
138 ########################################################################################################
139 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
140 ########################################################################################################
141
142 SET @@global.max_connect_errors = 5000;
143 SELECT @@max_connect_errors = @@global.max_connect_errors;
144
145
146 --echo '#---------------------FN_DYNVARS_073_09----------------------#'
147 ##########################################################################
148 # Check if max_connect_errors can be accessed with and without @@ sign #
149 ##########################################################################
150
151 --Error ER_GLOBAL_VARIABLE
152 SET max_connect_errors = 6000;
153 SELECT @@max_connect_errors;
154 --Error ER_UNKNOWN_TABLE
155 SELECT local.max_connect_errors;
156 --Error ER_UNKNOWN_TABLE
157 SELECT global.max_connect_errors;
158 --Error ER_BAD_FIELD_ERROR
159 SELECT max_connect_errors = @@session.max_connect_errors;
160
161
162 ##############################
163 # Restore initial value #
164 ##############################
165
166 SET @@global.max_connect_errors = @start_value;
167
168 ##################################################################
169 # END OF max_connect_errors TESTS #
170 ##################################################################