1
################# mysql-test\t\net_buffer_length_basic.test ###################
3
# Variable Name: net_buffer_length #
4
# Scope: GLOBAL | SESSION #
5
# Access Type: Dynamic #
7
# Default Value: 16384 #
8
# Range: 1024-1048576 #
11
# Creation Date: 2008-02-07 #
14
# Description: Test Cases of Dynamic System Variable net_buffer_length #
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
29
#################################################################
30
# START OF net_buffer_length TESTS #
31
#################################################################
34
#############################################################
35
# Save initial value #
36
#############################################################
38
SET @start_global_value = @@global.net_buffer_length;
39
# Due to differences in results of linux and windows
40
#SELECT @start_global_value;
42
# give a known value to @@session.net_buffer_length by assigning to
43
# @@global and setting up a new connection (for deterministic result
45
SET @@global.net_buffer_length = DEFAULT;
46
connect(con1,localhost,root,,);
49
--echo '#--------------------FN_DYNVARS_109_01-------------------------#'
50
#################################################################
51
# Display the DEFAULT value of net_buffer_length #
52
#################################################################
54
SET @@global.net_buffer_length = 10000;
55
SET @@global.net_buffer_length = DEFAULT;
56
SELECT @@global.net_buffer_length;
58
--Error ER_VARIABLE_IS_READONLY
59
SET @@session.net_buffer_length = 20000;
61
SET @@session.net_buffer_length = DEFAULT;
62
SELECT @@session.net_buffer_length;
65
--echo '#--------------------FN_DYNVARS_109_02-------------------------#'
66
########################################################################
67
# Check the DEFAULT value of net_buffer_length #
68
########################################################################
70
SET @@global.net_buffer_length = DEFAULT;
71
SELECT @@global.net_buffer_length = 16384;
74
--echo '#--------------------FN_DYNVARS_109_03-------------------------#'
75
###########################################################################
76
# Change the value of net_buffer_length to a valid value for GLOBAL Scope #
77
###########################################################################
79
SET @@global.net_buffer_length = 1024;
80
SELECT @@global.net_buffer_length;
81
SET @@global.net_buffer_length = 1025;
82
SELECT @@global.net_buffer_length;
83
SET @@global.net_buffer_length = 1048576;
84
SELECT @@global.net_buffer_length;
85
SET @@global.net_buffer_length = 1048575;
86
SELECT @@global.net_buffer_length;
87
SET @@global.net_buffer_length = 65535;
88
SELECT @@global.net_buffer_length;
89
--echo 'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
92
--echo '#--------------------FN_DYNVARS_109_04-------------------------#'
93
############################################################################
94
# Change the value of net_buffer_length to a valid value for SESSION Scope #
95
############################################################################
97
# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
100
--echo '#------------------FN_DYNVARS_109_05-----------------------#'
101
#############################################################
102
# Change the value of net_buffer_length to an invalid value #
103
#############################################################
105
SET @@global.net_buffer_length = 0;
106
SELECT @@global.net_buffer_length;
107
SET @@global.net_buffer_length = -1024;
108
SELECT @@global.net_buffer_length;
109
SET @@global.net_buffer_length = 1023;
110
SELECT @@global.net_buffer_length;
111
SET @@global.net_buffer_length = 1048577;
112
SELECT @@global.net_buffer_length;
113
SET @@global.net_buffer_length = 104857633;
114
SELECT @@global.net_buffer_length;
115
--Error ER_PARSE_ERROR
116
SET @@global.net_buffer_length = 65530.34.;
117
SELECT @@global.net_buffer_length;
118
--Error ER_WRONG_TYPE_FOR_VAR
119
SET @@global.net_buffer_length = test;
120
SELECT @@global.net_buffer_length;
122
# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
124
--echo 'Bug # 34837: Errors are not coming on assigning invalid values to variable';
126
--Error ER_WRONG_TYPE_FOR_VAR
127
SET @@session.net_buffer_length = test;
128
SELECT @@session.net_buffer_length;
131
--echo '#------------------FN_DYNVARS_109_06-----------------------#'
132
####################################################################
133
# Check if the value in GLOBAL Table matches value in variable #
134
####################################################################
137
SELECT @@global.net_buffer_length = VARIABLE_VALUE
138
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
139
WHERE VARIABLE_NAME='net_buffer_length';
141
--echo '#------------------FN_DYNVARS_109_07-----------------------#'
142
####################################################################
143
# Check if the value in SESSION Table matches value in variable #
144
####################################################################
146
SELECT @@session.net_buffer_length = VARIABLE_VALUE
147
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
148
WHERE VARIABLE_NAME='net_buffer_length';
151
--echo '#------------------FN_DYNVARS_109_08-----------------------#'
152
####################################################################
153
# Check if TRUE and FALSE values can be used on variable #
154
####################################################################
156
SET @@global.net_buffer_length = TRUE;
157
SELECT @@global.net_buffer_length;
158
SET @@global.net_buffer_length = FALSE;
159
SELECT @@global.net_buffer_length;
162
--echo '#---------------------FN_DYNVARS_109_09----------------------#'
163
#################################################################################
164
# Check if accessing variable with and without GLOBAL point to same variable #
165
#################################################################################
167
SET @@global.net_buffer_length = 2048;
168
SELECT @@net_buffer_length = @@global.net_buffer_length;
171
--echo '#---------------------FN_DYNVARS_109_10----------------------#'
172
########################################################################################################
173
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
174
########################################################################################################
176
# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
179
--echo '#---------------------FN_DYNVARS_109_11----------------------#'
180
############################################################################
181
# Check if net_buffer_length can be accessed with and without @@ sign #
182
############################################################################
184
# Bug#22891: SESSION net_buffer_length is now read-only; assignments skipped
185
SELECT @@net_buffer_length;
186
--Error ER_UNKNOWN_TABLE
187
SELECT local.net_buffer_length;
188
--Error ER_UNKNOWN_TABLE
189
SELECT session.net_buffer_length;
190
--Error ER_BAD_FIELD_ERROR
191
SELECT net_buffer_length = @@session.net_buffer_length;
194
####################################
195
# Restore initial value #
196
####################################
200
SET @@global.net_buffer_length = @start_global_value;
201
# Due to differences in results of linux and windows
202
#SELECT @@global.net_buffer_length;
205
######################################################
206
# END OF net_buffer_length TESTS #
207
######################################################