| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# Verify that the correct number of bytes are written by |
| 4 |
# mysql_encryption_file_write(...) if both MY_NABP and |
| 5 |
# MY_FNABP are not set. |
| 6 |
# |
| 7 |
# ==== Implementation ==== |
| 8 |
# |
| 9 |
# 1. Start the master with binlog_encryption on. |
| 10 |
# 2. Create a table t1 with a TEXT column. |
| 11 |
# 3. Execute a trx to insert a big text into the table to make |
| 12 |
# binlog cache spill to disk and ensure that the correct |
| 13 |
# number of bytes are written by mysql_encryption_file_write(...). |
| 14 |
# 4. Verify that an error 'ER_ERROR_ON_WRITE' is reported if there |
| 15 |
# is a failure on encrypting binlog cache temporary file. |
| 16 |
# ==== References ==== |
| 17 |
# |
| 18 |
# Wl#12079 Encrypt binary log caches at rest |
| 19 |
|
| 20 |
# This test script will be run only in non GR set up. |
| 21 |
--source include/not_group_replication_plugin.inc |
| 22 |
--source include/have_binlog_format_row.inc |
| 23 |
# Restrict the test runs to only debug builds, since we set DEBUG point in the test. |
| 24 |
--source include/have_debug.inc |
| 25 |
|
| 26 |
--let $data_size= `select 0.5 * @@global.binlog_cache_size` |
| 27 |
|
| 28 |
CREATE TABLE t1 (c1 TEXT); |
| 29 |
|
| 30 |
--let $debug_point= verify_mysql_encryption_file_write_bytes |
| 31 |
--source include/add_debug_point.inc |
| 32 |
|
| 33 |
eval INSERT INTO t1 VALUES (REPEAT('123', $data_size)); |
| 34 |
|
| 35 |
--let $debug_point= verify_mysql_encryption_file_write_bytes |
| 36 |
--source include/remove_debug_point.inc |
| 37 |
|
| 38 |
|
| 39 |
--let $debug_point= simulate_binlog_cache_temp_file_encrypt_fail |
| 40 |
--source include/add_debug_point.inc |
| 41 |
|
| 42 |
--replace_regex /(errno: .*)/(errno: #)/ |
| 43 |
--error ER_ERROR_ON_WRITE |
| 44 |
eval INSERT INTO t1 VALUES (REPEAT('456', $data_size)); |
| 45 |
|
| 46 |
--let $debug_point= simulate_binlog_cache_temp_file_encrypt_fail |
| 47 |
--source include/remove_debug_point.inc |
| 48 |
|
| 49 |
DROP TABLE t1; |