File: rpl_compress_bound.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 (54 lines) | stat: -rw-r--r-- 1,853 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
# ==== Purpose ====
#
# Verify that binlog compression falls back to uncompressed when the
# size of the compressed data would exceed a given threshold.
#
# The real threshold is 1 GiB, which is tested in rpl_compress_1g.
# However, that test is too slow, so it is marked 'big' and cannot
# execute frequently.  Here we artificially set a smaller bound in
# order to have a test that can execute quicker.
#
# ==== Requirements ====
#
# R1. If the compressed size of a transaction exceeds a threshold,
#     replication should fall back to uncompressed.
#
# ==== Implementation ====
#
# - Set a debug symbol that forces the bound to just 800 bytes.
# - Insert a row of random data that is 1 KiB.
# - Verify that it did not get compressed.
# - Verify that a 1 KiB row of compressible data does get compressed.
#
# ==== References ====
#
# BUG#33588473: Binlog compression breaks when compressed size exceeds 1 GiB 

--source include/have_debug.inc
--source include/have_binlog_format_row.inc
--source include/master-slave.inc

--echo ==== Initialize ====
SET @@session.binlog_transaction_compression = 1;
CREATE TABLE t (info TEXT, data BLOB);
--let $debug_point = binlog_transaction_compression_max_size_800
--source include/add_debug_point.inc

--echo ==== Test ====
INSERT INTO t VALUES('compressible', REPEAT('a', 1024));
INSERT INTO t VALUES('non-compressible', RANDOM_BYTES(1024));
--source include/sync_slave_sql_with_master.inc
--source include/rpl_connection_master.inc

--echo ==== Validate ====
--source include/save_binlog_position.inc
--let $keep_transaction_payload_events = 1
--source include/show_binlog_events.inc

--echo ==== Clean up ====
--let $debug_point = binlog_transaction_compression_max_size_800
--source include/remove_debug_point.inc
DROP TABLE t;
--source include/sync_slave_sql_with_master.inc

--source include/rpl_end.inc