File: connection_compression_zstd.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (68 lines) | stat: -rw-r--r-- 2,536 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#####################################################################
#                                                                   #
# Aim of the test is to test compression between the mysql client   #
# and server using the zstd library. It does the following :-       #
#  - Loads table with appropriate data.                             #
#  - Recieves it through the client using different compression     #
#    levels.                                                        #
#  - Compares the number of bytes sent from the server for each     #
#    instance.                                                      #
# Creation Date: 2019-05-29                                         #
# Author: Srikanth B R                                              #
#                                                                   #
#####################################################################

# Save the initial number of concurrent sessions
--source include/count_sessions.inc

# Create and populate the table to be used
CREATE TABLE t1 (
 id int,
 c2 int,
 c3 varchar(20),
 c4 varchar(20),
 c5 int,
 c6 int,
 c7 varchar(20),
 c8 varchar(20),
 c9 varchar(20),
 c10 int,
 c11 double,
 c12 varchar(20),
 c13 varchar(20),
 c14 double,
 c15 varchar(20),
 c16 int,
 c17 varchar(20)
) ENGINE = InnoDB;

LOAD DATA INFILE '../../std_data/inconsistent_scan.csv' INTO TABLE t1 COLUMNS TERMINATED BY "," IGNORE 1 LINES;

# Test without compression
SHOW STATUS LIKE 'Compression%';
FLUSH STATUS;
SELECT * FROM t1;
--let $size_uncompressed = query_get_value(SHOW STATUS LIKE 'Bytes_sent', Value, 1)


SET GLOBAL protocol_compression_algorithms="zstd";
# Test zstd compressed connection with maximum compression level.
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect(zstd_con, localhost, root,,,,,,,zstd,22);
SHOW STATUS LIKE 'Compression%';
FLUSH STATUS;
SELECT * FROM t1;
--let $size_compressed_level22 = query_get_value(SHOW STATUS LIKE 'Bytes_sent', Value, 1)
connection default;
disconnect zstd_con;

# Validate size of data transferred between the highest compression level offered by zstd and uncompressed data.
--let $assert_cond = $size_compressed_level22 < $size_uncompressed
--let $assert_text = Size of data transferred with default zstd level 22 compression should be less than the uncompressed data.
--source include/assert.inc

SET @@global.protocol_compression_algorithms=default;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc

DROP TABLE t1;