1
############# mysql-test\t\slave_compressed_protocol_basic.test ###############
3
# Variable Name: slave_compressed_protocol #
5
# Access Type: Dynamic #
7
# Default Value: FALSE #
11
# Creation Date: 2008-02-07 #
14
# Description: Test Cases of Dynamic System Variable slave_compressed_protocol#
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/not_embedded.inc
27
--source include/load_sysvars.inc
28
########################################################################
29
# START OF slave_compressed_protocol TESTS #
30
########################################################################
33
##############################################################################
34
# Saving initial value of slave_compressed_protocol in a temporary variable #
35
##############################################################################
37
SET @global_start_value = @@global.slave_compressed_protocol;
38
SELECT @global_start_value;
40
--echo '#--------------------FN_DYNVARS_147_01------------------------#'
41
########################################################################
42
# Display the DEFAULT value of slave_compressed_protocol #
43
########################################################################
45
SET @@global.slave_compressed_protocol = 1;
46
SET @@global.slave_compressed_protocol = DEFAULT;
47
SELECT @@global.slave_compressed_protocol;
49
--echo '#---------------------FN_DYNVARS_147_02-------------------------#'
50
###############################################################################
51
# Check if slave_compressed_protocol can be accessed with and without @@ sign #
52
###############################################################################
54
--Error ER_GLOBAL_VARIABLE
55
SET slave_compressed_protocol = 1;
56
SELECT @@slave_compressed_protocol;
57
--Error ER_UNKNOWN_TABLE
58
SELECT global.slave_compressed_protocol;
60
SET global slave_compressed_protocol = 1;
61
SELECT @@global.slave_compressed_protocol;
64
--echo '#--------------------FN_DYNVARS_147_03------------------------#'
65
########################################################################
66
# Change the value of slave_compressed_protocol to a valid value #
67
########################################################################
69
SET @@global.slave_compressed_protocol = 0;
70
SELECT @@global.slave_compressed_protocol;
71
SET @@global.slave_compressed_protocol = 1;
72
SELECT @@global.slave_compressed_protocol;
75
--echo '#--------------------FN_DYNVARS_147_04-------------------------#'
76
###########################################################################
77
# Change the value of slave_compressed_protocol to invalid value #
78
###########################################################################
80
--Error ER_WRONG_VALUE_FOR_VAR
81
SET @@global.slave_compressed_protocol = -1;
82
--Error ER_WRONG_VALUE_FOR_VAR
83
SET @@global.slave_compressed_protocol = 2;
84
--Error ER_WRONG_VALUE_FOR_VAR
85
SET @@global.slave_compressed_protocol = "1.00";
86
--Error ER_WRONG_VALUE_FOR_VAR
87
SET @@global.slave_compressed_protocol = "Y";
88
--Error ER_WRONG_VALUE_FOR_VAR
89
SET @@global.slave_compressed_protocol = YES;
90
--Error ER_WRONG_VALUE_FOR_VAR
91
SET @@global.slave_compressed_protocol = ONN;
92
--Error ER_WRONG_VALUE_FOR_VAR
93
SET @@global.slave_compressed_protocol = 0FF;
94
--Error ER_WRONG_VALUE_FOR_VAR
95
SET @@global.slave_compressed_protocol = ' 1';
96
--Error ER_WRONG_VALUE_FOR_VAR
97
SET @@global.slave_compressed_protocol = NO;
100
--echo '#-------------------FN_DYNVARS_147_05----------------------------#'
101
###########################################################################
102
# Test if accessing session slave_compressed_protocol gives error #
103
###########################################################################
105
--Error ER_GLOBAL_VARIABLE
106
SET @@session.slave_compressed_protocol = 0;
107
--Error ER_GLOBAL_VARIABLE
108
SET @@slave_compressed_protocol = 0;
109
--Error ER_GLOBAL_VARIABLE
110
SET @@local.slave_compressed_protocol = 0;
111
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
112
SELECT @@session.slave_compressed_protocol;
113
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
114
SELECT @@local.slave_compressed_protocol;
116
--echo '#----------------------FN_DYNVARS_147_06------------------------#'
117
#########################################################################
118
# Check if the value in SESSION Table contains variable value #
119
#########################################################################
121
SELECT count(VARIABLE_VALUE)
122
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
123
WHERE VARIABLE_NAME='slave_compressed_protocol';
125
--echo '#----------------------FN_DYNVARS_147_07------------------------#'
126
#########################################################################
127
# Check if the value in GLOBAL Table matches value in variable #
128
#########################################################################
130
SELECT @@global.slave_compressed_protocol = VARIABLE_VALUE
131
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
132
WHERE VARIABLE_NAME='slave_compressed_protocol';
133
SELECT @@global.slave_compressed_protocol;
134
SELECT VARIABLE_VALUE
135
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
136
WHERE VARIABLE_NAME='slave_compressed_protocol';
138
--echo '#---------------------FN_DYNVARS_147_08-------------------------#'
139
###################################################################
140
# Check if ON and OFF values can be used on variable #
141
###################################################################
143
SET @@global.slave_compressed_protocol = OFF;
144
SELECT @@global.slave_compressed_protocol;
145
SET @@global.slave_compressed_protocol = ON;
146
SELECT @@global.slave_compressed_protocol;
148
--echo '#---------------------FN_DYNVARS_147_09----------------------#'
149
###################################################################
150
# Check if TRUE and FALSE values can be used on variable #
151
###################################################################
153
SET @@global.slave_compressed_protocol = TRUE;
154
SELECT @@global.slave_compressed_protocol;
155
SET @@global.slave_compressed_protocol = FALSE;
156
SELECT @@global.slave_compressed_protocol;
158
##############################
159
# Restore initial value #
160
##############################
162
SET @@global.slave_compressed_protocol = @global_start_value;
163
SELECT @@global.slave_compressed_protocol;
165
###############################################################
166
# END OF slave_compressed_protocol TESTS #
167
###############################################################