Debian Codegraph @

mysql-test/suite/x/t/system_variable_compression_algorithms.test

raw
1 # Test a Mysqlx_compression_algorithms system variable by capabilities
2
3 --source include/xplugin_preamble.inc
4 --source include/xplugin_create_user.inc
5
6 --write_file $MYSQL_TMP_DIR/capabilities_compression_algorithm_get.xpl
7 -->import connection.macro
8 -->callmacro Verify_its_xprotocol_connection
9
10 Mysqlx.Connection.CapabilitiesGet {
11 }
12 -->recv capabilities[4].value.obj.fld[0]
13 EOF
14
15
16
17 --write_file $MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl
18 -->import connection.macro
19 -->quiet
20 -->callmacro Verify_its_xprotocol_connection
21
22 -->echo compression_algorithm = %VALUE%
23
24 Mysqlx.Connection.CapabilitiesSet {
25 capabilities {
26 capabilities {
27 name: "compression"
28 value {
29 type: OBJECT
30 obj {
31 fld {
32 key: "algorithm"
33 value {
34 type: SCALAR
35 scalar {
36 type: V_STRING
37 v_string {
38 value: "%VALUE%"
39 }
40 }
41 }
42 }
43 }
44 }
45 }
46 }
47 }
48 -->recvtype %RESULT%
49 EOF
50
51
52
53 --echo ##############################################
54 --echo ## Mysqlx_compression_algorithms = default (deflate,lz4,zstd_stream)
55 --echo
56
57 SET GLOBAL Mysqlx_compression_algorithms = DEFAULT;
58
59 exec $MYSQLXTEST
60 -u x_root --password='' -h127.0.0.1 --no-auth
61 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_get.xpl 2>&1;
62
63 exec $MYSQLXTEST
64 -u x_root --password='' -h127.0.0.1 --no-auth
65 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
66 -v%VALUE%=lz4_message -v%RESULT%=Mysqlx.Ok;
67
68 exec $MYSQLXTEST
69 -u x_root --password='' -h127.0.0.1 --no-auth
70 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
71 -v%VALUE%=deflate_stream -v%RESULT%=Mysqlx.Ok;
72
73 exec $MYSQLXTEST
74 -u x_root --password='' -h127.0.0.1 --no-auth
75 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
76 -v%VALUE%=zstd_stream -v%RESULT%=Mysqlx.Ok;
77
78 exec $MYSQLXTEST
79 -u x_root --password='' -h127.0.0.1 --no-auth
80 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
81 -v%VALUE%=wrong_name -v%RESULT%=Mysqlx.Error;
82
83 --echo ##############################################
84 --echo ## Mysqlx_compression_algorithms = deflate
85 --echo
86
87 SET GLOBAL Mysqlx_compression_algorithms = deflate_stream;
88
89 exec $MYSQLXTEST
90 -u x_root --password='' -h127.0.0.1 --no-auth
91 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_get.xpl 2>&1;
92
93 exec $MYSQLXTEST
94 -u x_root --password='' -h127.0.0.1 --no-auth
95 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
96 -v%VALUE%=lz4_message -v%RESULT%=Mysqlx.Error;
97
98 exec $MYSQLXTEST
99 -u x_root --password='' -h127.0.0.1 --no-auth
100 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
101 -v%VALUE%=deflate_stream -v%RESULT%=Mysqlx.Ok;
102
103 exec $MYSQLXTEST
104 -u x_root --password='' -h127.0.0.1 --no-auth
105 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
106 -v%VALUE%=zstd_stream -v%RESULT%=Mysqlx.Error;
107
108 exec $MYSQLXTEST
109 -u x_root --password='' -h127.0.0.1 --no-auth
110 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
111 -v%VALUE%=wrong_name -v%RESULT%=Mysqlx.Error;
112
113 --echo ##############################################
114 --echo ## Mysqlx_compression_algorithms = lz4
115 --echo
116
117 SET GLOBAL Mysqlx_compression_algorithms = lz4_message;
118
119 exec $MYSQLXTEST
120 -u x_root --password='' -h127.0.0.1 --no-auth
121 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_get.xpl 2>&1;
122
123 exec $MYSQLXTEST
124 -u x_root --password='' -h127.0.0.1 --no-auth
125 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
126 -v%VALUE%=lz4_message -v%RESULT%=Mysqlx.Ok;
127
128 exec $MYSQLXTEST
129 -u x_root --password='' -h127.0.0.1 --no-auth
130 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
131 -v%VALUE%=deflate_stream -v%RESULT%=Mysqlx.Error;
132
133 exec $MYSQLXTEST
134 -u x_root --password='' -h127.0.0.1 --no-auth
135 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
136 -v%VALUE%=zstd_stream -v%RESULT%=Mysqlx.Error;
137
138 exec $MYSQLXTEST
139 -u x_root --password='' -h127.0.0.1 --no-auth
140 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
141 -v%VALUE%=wrong_name -v%RESULT%=Mysqlx.Error;
142
143 --echo ##############################################
144 --echo ## Mysqlx_compression_algorithms = zstd_stream
145 --echo
146
147 SET GLOBAL Mysqlx_compression_algorithms = zstd_stream;
148
149 exec $MYSQLXTEST
150 -u x_root --password='' -h127.0.0.1 --no-auth
151 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_get.xpl 2>&1;
152
153 exec $MYSQLXTEST
154 -u x_root --password='' -h127.0.0.1 --no-auth
155 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
156 -v%VALUE%=lz4_message -v%RESULT%=Mysqlx.Error;
157
158 exec $MYSQLXTEST
159 -u x_root --password='' -h127.0.0.1 --no-auth
160 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
161 -v%VALUE%=deflate_stream -v%RESULT%=Mysqlx.Error;
162
163 exec $MYSQLXTEST
164 -u x_root --password='' -h127.0.0.1 --no-auth
165 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
166 -v%VALUE%=zstd_stream -v%RESULT%=Mysqlx.Ok;
167
168 exec $MYSQLXTEST
169 -u x_root --password='' -h127.0.0.1 --no-auth
170 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
171 -v%VALUE%=wrong_name -v%RESULT%=Mysqlx.Error;
172
173 --echo ##############################################
174 --echo ## Mysqlx_compression_algorithms = empty
175 --echo
176
177 SET GLOBAL Mysqlx_compression_algorithms = '';
178
179 exec $MYSQLXTEST
180 -u x_root --password='' -h127.0.0.1 --no-auth
181 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_get.xpl 2>&1;
182
183 exec $MYSQLXTEST
184 -u x_root --password='' -h127.0.0.1 --no-auth
185 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
186 -v%VALUE%=lz4_message -v%RESULT%=Mysqlx.Error;
187
188 exec $MYSQLXTEST
189 -u x_root --password='' -h127.0.0.1 --no-auth
190 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
191 -v%VALUE%=deflate_stream -v%RESULT%=Mysqlx.Error;
192
193 exec $MYSQLXTEST
194 -u x_root --password='' -h127.0.0.1 --no-auth
195 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
196 -v%VALUE%=zstd_stream -v%RESULT%=Mysqlx.Error;
197
198 exec $MYSQLXTEST
199 -u x_root --password='' -h127.0.0.1 --no-auth
200 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
201 -v%VALUE%=wrong_name -v%RESULT%=Mysqlx.Error;
202
203 --echo ##############################################
204 --echo ## Mysqlx_compression_algorithms = deflate,lz4,zstd_stream
205 --echo
206
207 SET GLOBAL Mysqlx_compression_algorithms = 'deflate_stream,lz4_message,zstd_stream';
208
209 exec $MYSQLXTEST
210 -u x_root --password='' -h127.0.0.1 --no-auth
211 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_get.xpl 2>&1;
212
213 exec $MYSQLXTEST
214 -u x_root --password='' -h127.0.0.1 --no-auth
215 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
216 -v%VALUE%=lz4_message -v%RESULT%=Mysqlx.Ok;
217
218 exec $MYSQLXTEST
219 -u x_root --password='' -h127.0.0.1 --no-auth
220 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
221 -v%VALUE%=deflate_stream -v%RESULT%=Mysqlx.Ok;
222
223 exec $MYSQLXTEST
224 -u x_root --password='' -h127.0.0.1 --no-auth
225 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
226 -v%VALUE%=zstd_stream -v%RESULT%=Mysqlx.Ok;
227
228 exec $MYSQLXTEST
229 -u x_root --password='' -h127.0.0.1 --no-auth
230 --file=$MYSQL_TMP_DIR/capabilities_compression_algorithm_set.xpl 2>&1
231 -v%VALUE%=wrong_name -v%RESULT%=Mysqlx.Error;
232
233 ## Cleanup
234 SET GLOBAL Mysqlx_compression_algorithms = DEFAULT;
235 --source ../include/xplugin_cleanup.inc