Debian Codegraph @

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

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