Debian Codegraph @

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

raw
1 ############# mysql-test\t\slave_compressed_protocol_basic.test ###############
2 # #
3 # Variable Name: slave_compressed_protocol #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: boolean #
7 # Default Value: FALSE #
8 # Range: TRUE, FALSE #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Rizwan #
13 # #
14 # Description: Test Cases of Dynamic System Variable slave_compressed_protocol#
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/not_embedded.inc
27 --source include/load_sysvars.inc
28 ########################################################################
29 # START OF slave_compressed_protocol TESTS #
30 ########################################################################
31
32
33 ##############################################################################
34 # Saving initial value of slave_compressed_protocol in a temporary variable #
35 ##############################################################################
36
37 SET @global_start_value = @@global.slave_compressed_protocol;
38 SELECT @global_start_value;
39
40 --echo '#--------------------FN_DYNVARS_147_01------------------------#'
41 ########################################################################
42 # Display the DEFAULT value of slave_compressed_protocol #
43 ########################################################################
44
45 SET @@global.slave_compressed_protocol = 1;
46 SET @@global.slave_compressed_protocol = DEFAULT;
47 SELECT @@global.slave_compressed_protocol;
48
49 --echo '#---------------------FN_DYNVARS_147_02-------------------------#'
50 ###############################################################################
51 # Check if slave_compressed_protocol can be accessed with and without @@ sign #
52 ###############################################################################
53
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;
59
60 SET global slave_compressed_protocol = 1;
61 SELECT @@global.slave_compressed_protocol;
62
63
64 --echo '#--------------------FN_DYNVARS_147_03------------------------#'
65 ########################################################################
66 # Change the value of slave_compressed_protocol to a valid value #
67 ########################################################################
68
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;
73
74
75 --echo '#--------------------FN_DYNVARS_147_04-------------------------#'
76 ###########################################################################
77 # Change the value of slave_compressed_protocol to invalid value #
78 ###########################################################################
79
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;
98
99
100 --echo '#-------------------FN_DYNVARS_147_05----------------------------#'
101 ###########################################################################
102 # Test if accessing session slave_compressed_protocol gives error #
103 ###########################################################################
104
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;
115
116 --echo '#----------------------FN_DYNVARS_147_06------------------------#'
117 #########################################################################
118 # Check if the value in SESSION Table contains variable value #
119 #########################################################################
120
121 SELECT count(VARIABLE_VALUE)
122 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
123 WHERE VARIABLE_NAME='slave_compressed_protocol';
124
125 --echo '#----------------------FN_DYNVARS_147_07------------------------#'
126 #########################################################################
127 # Check if the value in GLOBAL Table matches value in variable #
128 #########################################################################
129
130 SELECT IF(@@global.slave_compressed_protocol, "ON", "OFF") = 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';
137
138 --echo '#---------------------FN_DYNVARS_147_08-------------------------#'
139 ###################################################################
140 # Check if ON and OFF values can be used on variable #
141 ###################################################################
142
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;
147
148 --echo '#---------------------FN_DYNVARS_147_09----------------------#'
149 ###################################################################
150 # Check if TRUE and FALSE values can be used on variable #
151 ###################################################################
152
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;
157
158 ##############################
159 # Restore initial value #
160 ##############################
161
162 SET @@global.slave_compressed_protocol = @global_start_value;
163 SELECT @@global.slave_compressed_protocol;
164
165 ###############################################################
166 # END OF slave_compressed_protocol TESTS #
167 ###############################################################