| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# Verify that binlog compression falls back to uncompressed when the |
| 4 |
# size of the compressed data would exceed a given threshold. |
| 5 |
# |
| 6 |
# The real threshold is 1 GiB, which is tested in rpl_compress_1g. |
| 7 |
# However, that test is too slow, so it is marked 'big' and cannot |
| 8 |
# execute frequently. Here we artificially set a smaller bound in |
| 9 |
# order to have a test that can execute quicker. |
| 10 |
# |
| 11 |
# ==== Requirements ==== |
| 12 |
# |
| 13 |
# R1. If the compressed size of a transaction exceeds a threshold, |
| 14 |
# replication should fall back to uncompressed. |
| 15 |
# |
| 16 |
# ==== Implementation ==== |
| 17 |
# |
| 18 |
# - Set a debug symbol that forces the bound to just 800 bytes. |
| 19 |
# - Insert a row of random data that is 1 KiB. |
| 20 |
# - Verify that it did not get compressed. |
| 21 |
# - Verify that a 1 KiB row of compressible data does get compressed. |
| 22 |
# |
| 23 |
# ==== References ==== |
| 24 |
# |
| 25 |
# BUG#33588473: Binlog compression breaks when compressed size exceeds 1 GiB |
| 26 |
|
| 27 |
--source include/have_debug.inc |
| 28 |
--source include/have_binlog_format_row.inc |
| 29 |
--source include/master-slave.inc |
| 30 |
|
| 31 |
--echo ==== Initialize ==== |
| 32 |
SET @@session.binlog_transaction_compression = 1; |
| 33 |
CREATE TABLE t (info TEXT, data BLOB); |
| 34 |
--let $debug_point = binlog_transaction_compression_max_size_800 |
| 35 |
--source include/add_debug_point.inc |
| 36 |
|
| 37 |
--echo ==== Test ==== |
| 38 |
INSERT INTO t VALUES('compressible', REPEAT('a', 1024)); |
| 39 |
INSERT INTO t VALUES('non-compressible', RANDOM_BYTES(1024)); |
| 40 |
--source include/sync_slave_sql_with_master.inc |
| 41 |
--source include/rpl_connection_master.inc |
| 42 |
|
| 43 |
--echo ==== Validate ==== |
| 44 |
--source include/save_binlog_position.inc |
| 45 |
--let $keep_transaction_payload_events = 1 |
| 46 |
--source include/show_binlog_events.inc |
| 47 |
|
| 48 |
--echo ==== Clean up ==== |
| 49 |
--let $debug_point = binlog_transaction_compression_max_size_800 |
| 50 |
--source include/remove_debug_point.inc |
| 51 |
DROP TABLE t; |
| 52 |
--source include/sync_slave_sql_with_master.inc |
| 53 |
|
| 54 |
--source include/rpl_end.inc |