# ==== Purpose ==== # # Verify that the correct number of bytes are written by # mysql_encryption_file_write(...) if both MY_NABP and # MY_FNABP are not set. # # ==== Implementation ==== # # 1. Start the master with binlog_encryption on. # 2. Create a table t1 with a TEXT column. # 3. Execute a trx to insert a big text into the table to make # binlog cache spill to disk and ensure that the correct # number of bytes are written by mysql_encryption_file_write(...). # 4. Verify that an error 'ER_ERROR_ON_WRITE' is reported if there # is a failure on encrypting binlog cache temporary file. # ==== References ==== # # Wl#12079 Encrypt binary log caches at rest # This test script will be run only in non GR set up. --source include/not_group_replication_plugin.inc --source include/have_binlog_format_row.inc # Restrict the test runs to only debug builds, since we set DEBUG point in the test. --source include/have_debug.inc --let $data_size= `select 0.5 * @@global.binlog_cache_size` CREATE TABLE t1 (c1 TEXT); --let $debug_point= verify_mysql_encryption_file_write_bytes --source include/add_debug_point.inc eval INSERT INTO t1 VALUES (REPEAT('123', $data_size)); --let $debug_point= verify_mysql_encryption_file_write_bytes --source include/remove_debug_point.inc --let $debug_point= simulate_binlog_cache_temp_file_encrypt_fail --source include/add_debug_point.inc --replace_regex /(errno: .*)/(errno: #)/ --error ER_ERROR_ON_WRITE eval INSERT INTO t1 VALUES (REPEAT('456', $data_size)); --let $debug_point= simulate_binlog_cache_temp_file_encrypt_fail --source include/remove_debug_point.inc DROP TABLE t1;