| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# To cover an error branch when executing the command |
| 4 |
# 'ALTER INSTANCE ROTATE BINLOG MASTER KEY' on a server |
| 5 |
# with binary log enabled. |
| 6 |
# |
| 7 |
# ==== Implementation ==== |
| 8 |
# |
| 9 |
# 1. Set a debug point. |
| 10 |
# 2. Verify that an expected error is emitted to the client side on the |
| 11 |
# session when executing the command 'ALTER INSTANCE ROTATE BINLOG |
| 12 |
# MASTER KEY'. |
| 13 |
# 3. Remove the debug point. |
| 14 |
# 4. Verify that 'ALTER INSTANCE ROTATE BINLOG MASTER KEY' works after |
| 15 |
# an error happens in the last execution. |
| 16 |
# |
| 17 |
# ==== Usage ==== |
| 18 |
# |
| 19 |
# --let $MASTER_DATADIR= `select @@datadir` |
| 20 |
# --let $debug_point= |
| 21 |
# --let $expected_error= |
| 22 |
# --let $first_encrypted_binary_log= |
| 23 |
# --let $current_master_key_id= |
| 24 |
# --let $current_comparison_digit= |
| 25 |
# --let $rotated_master_key_id= |
| 26 |
# --let $rotated_comparison_digit= |
| 27 |
# --let $rotate_binary_log= |
| 28 |
# --source suite/binlog/include/binlog_rotate_binlog_master_key_errors.inc |
| 29 |
# |
| 30 |
# Parameters: |
| 31 |
# |
| 32 |
# $debug_point |
| 33 |
# Set a debug point to cause 'ALTER INSTANCE ROTATE BINLOG MASTER KEY' |
| 34 |
# throw an expected error specified by $expected_error. |
| 35 |
# |
| 36 |
# $expected_error |
| 37 |
# Specify an expected error while executing |
| 38 |
# 'ALTER INSTANCE ROTATE BINLOG MASTER KEY' |
| 39 |
# with a debug_point set by $debug_point. |
| 40 |
# |
| 41 |
# $first_encrypted_binary_log |
| 42 |
# The first encrypted binary log. |
| 43 |
# |
| 44 |
# $current_master_key_id |
| 45 |
# The master key id before rotating binlog master key. |
| 46 |
# |
| 47 |
# $current_comparison_digit |
| 48 |
# The comparison digit of $current_master_key_id |
| 49 |
# |
| 50 |
# $rotated_master_key_id |
| 51 |
# The master key id after rotating binlog master key. |
| 52 |
# |
| 53 |
# $rotated_comparison_digit |
| 54 |
# The comparison digit of $rotated_master_key_id |
| 55 |
# |
| 56 |
# $rotate_binary_log |
| 57 |
# Set it to 1 if you need to rotate binary log after executing |
| 58 |
# 'ALTER INSTANCE ROTATE BINLOG MASTER KEY' throws an expected |
| 59 |
# error. Otherwise set it to 0. |
| 60 |
# |
| 61 |
# ==== References ==== |
| 62 |
# |
| 63 |
# Wl#12080 Add support to binary log encryption key rotation and cleanup |
| 64 |
|
| 65 |
--source include/add_debug_point.inc |
| 66 |
--replace_result \\ / |
| 67 |
--error $expected_error |
| 68 |
ALTER INSTANCE ROTATE BINLOG MASTER KEY; |
| 69 |
--source include/remove_debug_point.inc |
| 70 |
|
| 71 |
if ($rotate_binary_log) |
| 72 |
{ |
| 73 |
FLUSH BINARY LOGS; |
| 74 |
} |
| 75 |
|
| 76 |
--source suite/binlog/include/binlog_rotate_binlog_master_key_work.inc |