Debian Codegraph @

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

raw
1 # There are three levels on which the feature is verified:
2 #
3 # * on X Protocol layer (without decompression)
4 # * confirming that resultset flow is correct
5 # * confirming that resultset contains correct data
6 #
7 # This test confirms that compression works on server side, it does verification
8 # of result-set data (bullet no 3). The validation is done in result file.
9 #
10 #
11 # Following is verified:
12 #
13 # server->client: Mysqlx.Connection.Compression
14 #
15 # In which X Plugin compresses by default following messages:
16 #
17 # * NOTICE - 11, 0x0b
18 # * RESULTSET_COLUMN_META_DATA - 12, 0x0c
19 # * RESULTSET_ROW - 13, 0x0d
20 # * RESULTSET_FETCH_DONE - 14, 0x0e
21 #
22 # followed with uncompressed:
23 #
24 # * SQL_STMT_EXECUTE_OK = 17 0x11
25 #
26 # The server is going to use following messages to transfer
27 # compressed payload:
28 #
29 # * COMPRESSION = 19; 0x13
30 #
31 #
32
33 ##
34 ## Please take a note that this test (and others) use following terms:
35 ## SINGLE, MULTIPLE, GROUP
36 ##
37 ## Those correspond to concrete setting of compression capabilities:
38 ## server_combine_mixed_messages, server_max_combine_messages and
39 ## describe only compressed messages generated by the server.
40 ##
41 ## * SINGLE - it corresponds to
42 ## server_combine_mixed_messages=TRUE|FALSE,
43 ## server_max_combine_messages=1
44 ## In this configuration exact one X Protocol message is
45 ## encapsulated in one Mysqlx.Connection.Compression
46 ##
47 ## * MULTIPLE - it corresponds to
48 ## server_combine_mixed_messages=FALSE,
49 ## server_max_combine_messages=UNSET|0
50 ## In this configuration multiple X Protocol messages
51 ## of the same type are encapsulated in one
52 ## Mysqlx.Connection.Compression
53 ##
54 ## * GROUP - it corresponds to
55 ## server_combine_mixed_messages=TRUE,
56 ## server_max_combine_messages=UNSET|0
57 ## In this configuration multiple X Protocol messages
58 ## of different types are encapsulated in one
59 ## Mysqlx.Connection.Compression
60 ##
61 ## Cases where "server_max_combine_message" has values grater than 1
62 ## are in separate test file: compression_limit_message_count.test
63 ##
64
65 --source include/xplugin_preamble.inc
66 --source include/xplugin_create_user.inc
67
68 ## Test starts here
69 --write_file $MYSQL_TMP_DIR/resultset.xpl
70 -->import assert_status_variable.macro
71
72 -->echo
73 -->echo
74 -->echo ## I. Validate simple resultsets
75 -->echo #
76 -->echo # 1. Assert resultset for select with single column
77 -->echo # 2. Assert resultset for select with multiple columns
78 -->echo # 3. Assert resultset for select with multiple rows
79 -->echo
80 -->echo ## II. Validate simple multi-resultsets
81 -->echo #
82 -->echo # 1. Assert two resultsets for select queries
83 -->echo # 2. Assert three resultsets for select queries
84 -->echo
85 -->echo ## III. Assert client side status variables
86 -->echo #
87 -->echo
88
89
90 -->echo
91 -->echo #
92 -->echo # I.1
93 SELECT 1;
94 SELECT 1 as "Value";
95
96 -->echo
97 -->echo #
98 -->echo # I.2
99 SELECT 1 as "Column1", 2 as "Column2", 3 as "Column3";
100 SELECT phrase FROM xtest.xtable;
101 SELECT phrase, prio FROM xtest.xtable;
102
103 -->echo
104 -->echo #
105 -->echo # II.1
106 CALL two_resultsets();
107
108 -->echo
109 -->echo #
110 -->echo # II.2
111 CALL three_results_sets();
112
113
114 -->echo
115 -->echo #
116 -->echo # III
117 callmacro Assert_client_message_count Mysqlx.Connection.Compression == %COMP_COUNT%;
118
119 EOF
120
121 let $STORED_PROC_DB_NAME=xtest;
122 source ../include/stored_procedures.inc;
123 source ../include/sample_tables.inc;
124 CALL recreate_tables();
125
126
127 --echo
128 --echo ## A. Execute the test using zlib/single
129 --echo #
130
131 exec $MYSQLXTEST
132 -ux_root --password=''
133 --schema=xtest
134 --compression-mode=required --compression-algorithm=deflate_stream
135 --compression-combine-mixed-messages=0
136 --compression-max-combine-messages=1
137 -v%COMP_COUNT%=59
138 --file=$MYSQL_TMP_DIR/resultset.xpl 2>&1;
139
140
141 --echo
142 --echo ## B. Execute the test using lz4/single
143 --echo #
144
145 exec $MYSQLXTEST
146 -ux_root --password=''
147 --schema=xtest
148 --compression-mode=required --compression-algorithm=lz4_message
149 --compression-combine-mixed-messages=0
150 --compression-max-combine-messages=1
151 -v%COMP_COUNT%=59
152 -v%MULTIPLE_COUNT%=0
153 -v%GROUP_COUNT%=0
154 --file=$MYSQL_TMP_DIR/resultset.xpl 2>&1;
155
156
157 --echo
158 --echo ## C. Execute the test using zlib/multiple
159 --echo #
160
161 exec $MYSQLXTEST
162 -ux_root --password=''
163 --schema=xtest
164 --compression-mode=required --compression-algorithm=deflate_stream
165 --compression-combine-mixed-messages=0
166 --compression-max-combine-messages=0
167 -v%COMP_COUNT%=39
168 --file=$MYSQL_TMP_DIR/resultset.xpl 2>&1;
169
170
171 --echo
172 --echo ## D. Execute the test using lz4/multiple
173 --echo #
174
175 exec $MYSQLXTEST
176 -ux_root --password=''
177 --schema=xtest
178 --compression-mode=required --compression-algorithm=lz4_message
179 --compression-combine-mixed-messages=0
180 --compression-max-combine-messages=0
181 -v%COMP_COUNT%=39
182 --file=$MYSQL_TMP_DIR/resultset.xpl 2>&1;
183
184
185 --echo
186 --echo ## E. Execute the test using zlib/group
187 --echo #
188
189 exec $MYSQLXTEST
190 -ux_root --password=''
191 --schema=xtest
192 --compression-mode=required --compression-algorithm=deflate_stream
193 --compression-combine-mixed-messages=1
194 --compression-max-combine-messages=0
195 -v%COMP_COUNT%=7
196 --file=$MYSQL_TMP_DIR/resultset.xpl 2>&1;
197
198
199 --echo
200 --echo ## F. Execute the test using lz4/group
201 --echo #
202
203 exec $MYSQLXTEST
204 -ux_root --password=''
205 --schema=xtest
206 --compression-mode=required --compression-algorithm=lz4_message
207 --compression-combine-mixed-messages=1
208 --compression-max-combine-messages=0
209 -v%COMP_COUNT%=7
210 --file=$MYSQL_TMP_DIR/resultset.xpl 2>&1;
211
212 --echo
213 --echo ## G. Execute the test using zstd/single
214 --echo #
215
216 exec $MYSQLXTEST
217 -ux_root --password=''
218 --schema=xtest
219 --compression-mode=required
220 --compression-algorithm=zstd_stream
221 --compression-combine-mixed-messages=0
222 --compression-max-combine-messages=1
223 -v%COMP_COUNT%=59
224 -v%MULTIPLE_COUNT%=0
225 -v%GROUP_COUNT%=0
226 --file=$MYSQL_TMP_DIR/resultset.xpl 2>&1;
227
228 --echo
229 --echo ## H. Execute the test using zstd/multiple
230 --echo #
231
232 exec $MYSQLXTEST
233 -ux_root --password=''
234 --schema=xtest
235 --compression-mode=required
236 --compression-algorithm=zstd_stream
237 --compression-combine-mixed-messages=0
238 --compression-max-combine-messages=0
239 -v%COMP_COUNT%=39
240 --file=$MYSQL_TMP_DIR/resultset.xpl 2>&1;
241
242 --echo
243 --echo ## I. Execute the test using zstd/group
244 --echo #
245
246 exec $MYSQLXTEST
247 -ux_root --password=''
248 --schema=xtest
249 --compression-mode=required
250 --compression-algorithm=zstd_stream
251 --compression-combine-mixed-messages=1
252 --compression-max-combine-messages=0
253 -v%COMP_COUNT%=7
254 --file=$MYSQL_TMP_DIR/resultset.xpl 2>&1;
255
256 ## Cleanup
257 --source ../include/xplugin_cleanup.inc