Debian Codegraph @

mysql-test/suite/rpl/t/rpl_binlog_cache_temp_file_encryption_myisam.test

raw
1 # ==== Purpose ====
2 #
3 # 1. Verify that the temporary file of binlog cache is encrypted when
4 # the binlog cache spills to disk if binlog_encryption is on.
5 # 2. Verify that 'SET GLOBAL binlog_encryption' takes effect immediately
6 # on binlog cache temporary file encryption.
7 # 3. Verify that binlog cache is reset at commit/rollback time.
8 #
9 # ==== Implementation ====
10 #
11 # 1. Start the master with binlog_encryption on.
12 # 2. Create a table t2 with a TEXT column.
13 # 3. Execute a trx to insert a big text into the tables to make
14 # binlog cache spill to disk and ensure that the temporary
15 # file of binlog cache is encrypted.
16 # 4. SET GLOBAL binlog_encryption=OFF
17 # 5. Execute a trx to ensure binlog cache temporary file encryption
18 # is disabled.
19 # 6. SET GLOBAL binlog_encryption=ON
20 # 7. Execute a trx to insert a big text into the tables to make
21 # binlog cache spill to disk and ensure that the temporary
22 # file of binlog cache is encrypted.
23 # 8. Commit a trx ensure that binlog cache is reset at commit time.
24 # 9. Verify that there is no difference on the table between
25 # master and slave.
26 #
27 # ==== References ====
28 #
29 # Wl#12079 Encrypt binary log caches at rest
30 # Bug#29475234 'BINLOG_ENCRYPTION' VALUE WONT TAKE IMMEDIATE EFFECT ON ENCRYPTING BINLOG CACHES
31
32 # This test script will be run only in non GR set up.
33 --source include/not_group_replication_plugin.inc
34 --source include/master-slave.inc
35 --source include/have_binlog_format_row.inc
36 # Restrict the test runs to only debug builds, since we set DEBUG point in the test.
37 --source include/have_debug.inc
38 --source include/force_myisam_default.inc
39 --source include/have_myisam.inc
40
41 --let $data_size= `select 0.5 * @@global.binlog_cache_size`
42
43 CREATE TABLE t2 (c2 TEXT) ENGINE=MYISAM;
44
45 --let $debug_point= ensure_binlog_cache_temporary_file_is_encrypted
46 --source include/add_debug_point.inc
47
48 eval INSERT INTO t2 VALUES (REPEAT('123', $data_size));
49
50 --let $debug_point= ensure_binlog_cache_temporary_file_is_encrypted
51 --source include/remove_debug_point.inc
52
53 SET GLOBAL binlog_encryption=OFF;
54 --let $debug_point= ensure_binlog_cache_temp_file_encryption_is_disabled
55 --source include/add_debug_point.inc
56
57 eval INSERT INTO t2 VALUES (REPEAT('off', $data_size));
58
59 --let $debug_point= ensure_binlog_cache_temp_file_encryption_is_disabled
60 --source include/remove_debug_point.inc
61
62 SET GLOBAL binlog_encryption=ON;
63 --let $debug_point= ensure_binlog_cache_temporary_file_is_encrypted
64 --source include/add_debug_point.inc
65
66 eval INSERT INTO t2 VALUES (REPEAT('on1', $data_size));
67
68 --let $debug_point= ensure_binlog_cache_temporary_file_is_encrypted
69 --source include/remove_debug_point.inc
70
71 --let $debug_point= ensure_binlog_cache_is_reset
72 --source include/add_debug_point.inc
73
74
75 INSERT INTO t2 VALUES ("567");
76
77 --let $debug_point= ensure_binlog_cache_is_reset
78 --source include/remove_debug_point.inc
79
80 --source include/sync_slave_sql_with_master.inc
81
82 # Cleanup
83 --source include/rpl_connection_master.inc
84 DROP TABLE t2;
85
86 --source include/rpl_end.inc