Skip to content

Commit b85a001

Browse files
committed
MDEV-8264 encryption for binlog
* Start_encryption_log_event * --encrypt-binlog command line option based on google patches.
1 parent 41d68ca commit b85a001

21 files changed

+753
-198
lines changed

client/mysqlbinlog.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2575,6 +2575,11 @@ void *sql_alloc(size_t size)
25752575
return alloc_root(&s_mem_root, size);
25762576
}
25772577

2578+
struct encryption_service_st encryption_handler=
2579+
{
2580+
0, 0, 0, 0, 0, 0, 0
2581+
};
2582+
25782583
/*
25792584
We must include this here as it's compiled with different options for
25802585
the server

mysql-test/include/binlog_start_pos.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@
1010
#
1111
# Format_description_log_event length =
1212
# 19 /* event common header */ +
13-
# 57 /* misc stuff in the Format description header */ +
13+
# 58 /* misc stuff in the Format description header */ +
1414
# number of events +
1515
# 1 /* Checksum algorithm */ +
1616
# 4 /* CRC32 length */
1717
#
18-
# With current number of events = 163,
18+
# With current number of events = 164,
1919
#
20-
# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 248.
20+
# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 249.
2121
#
2222
##############################################################################
2323

24-
let $binlog_start_pos=248;
24+
let $binlog_start_pos=249;
2525
--disable_query_log
26-
SET @binlog_start_pos=248;
26+
SET @binlog_start_pos=249;
2727
--enable_query_log
2828

mysql-test/include/show_binlog_events2.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if ($binlog_start)
44
}
55
if (!$binlog_start)
66
{
7-
--let $_binlog_start=248
7+
--let $_binlog_start=249
88
}
99
if ($binlog_file)
1010
{

mysql-test/r/mysqld--help.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ The following options may be given as the first argument:
176176
--div-precision-increment=#
177177
Precision of the result of '/' operator will be increased
178178
on that value
179+
--encrypt-binlog Encrypt binary logs (including relay logs)
180+
(Defaults to on; use --skip-encrypt-binlog to disable.)
179181
--encrypt-tmp-disk-tables
180182
Encrypt temporary on-disk tables (created as part of
181183
query execution)
@@ -1170,6 +1172,7 @@ delayed-insert-limit 100
11701172
delayed-insert-timeout 300
11711173
delayed-queue-size 1000
11721174
div-precision-increment 4
1175+
encrypt-binlog TRUE
11731176
encrypt-tmp-disk-tables FALSE
11741177
encrypt-tmp-files TRUE
11751178
enforce-storage-engine (No default value)

mysql-test/suite/rpl/r/rpl_checksum.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ insert into t1 values (1) /* will not be applied on slave due to simulation */;
7171
set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
7272
start slave;
7373
include/wait_for_slave_io_error.inc [errno=1236]
74-
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'master-bin.000009' at 367, the last event read from 'master-bin.000010' at 4, the last byte read from 'master-bin.000010' at 248.''
74+
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'master-bin.000009' at 368, the last event read from 'master-bin.000010' at 4, the last byte read from 'master-bin.000010' at 249.''
7575
select count(*) as zero from t1;
7676
zero
7777
0

mysql-test/suite/sys_vars/r/sysvars_server_embedded.result

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,20 @@ NUMERIC_BLOCK_SIZE 1
695695
ENUM_VALUE_LIST NULL
696696
READ_ONLY NO
697697
COMMAND_LINE_ARGUMENT REQUIRED
698+
VARIABLE_NAME ENCRYPT_BINLOG
699+
SESSION_VALUE NULL
700+
GLOBAL_VALUE ON
701+
GLOBAL_VALUE_ORIGIN COMPILE-TIME
702+
DEFAULT_VALUE ON
703+
VARIABLE_SCOPE GLOBAL
704+
VARIABLE_TYPE BOOLEAN
705+
VARIABLE_COMMENT Encrypt binary logs (including relay logs)
706+
NUMERIC_MIN_VALUE NULL
707+
NUMERIC_MAX_VALUE NULL
708+
NUMERIC_BLOCK_SIZE NULL
709+
ENUM_VALUE_LIST OFF,ON
710+
READ_ONLY YES
711+
COMMAND_LINE_ARGUMENT OPTIONAL
698712
VARIABLE_NAME ENCRYPT_TMP_DISK_TABLES
699713
SESSION_VALUE NULL
700714
GLOBAL_VALUE OFF

0 commit comments

Comments
 (0)