# ==== 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