~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to mysql-test/suite/sys_vars/t/net_write_timeout_basic.test

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2011-11-08 11:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20111108113113-3ulw01fvi4vn8m25
Tags: upstream-5.5.17
ImportĀ upstreamĀ versionĀ 5.5.17

Show diffs side-by-side

added added

removed removed

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