Skip to content

Commit

Permalink
MDEV-8264 encryption for binlog
Browse files Browse the repository at this point in the history
* Start_encryption_log_event
* --encrypt-binlog command line option

based on google patches.
  • Loading branch information
vuvova committed Sep 4, 2015
1 parent 41d68ca commit b85a001
Show file tree
Hide file tree
Showing 21 changed files with 753 additions and 198 deletions.
5 changes: 5 additions & 0 deletions client/mysqlbinlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2575,6 +2575,11 @@ void *sql_alloc(size_t size)
return alloc_root(&s_mem_root, size);
}

struct encryption_service_st encryption_handler=
{
0, 0, 0, 0, 0, 0, 0
};

/*
We must include this here as it's compiled with different options for
the server
Expand Down
10 changes: 5 additions & 5 deletions mysql-test/include/binlog_start_pos.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
#
# Format_description_log_event length =
# 19 /* event common header */ +
# 57 /* misc stuff in the Format description header */ +
# 58 /* misc stuff in the Format description header */ +
# number of events +
# 1 /* Checksum algorithm */ +
# 4 /* CRC32 length */
#
# With current number of events = 163,
# With current number of events = 164,
#
# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 248.
# binlog_start_pos = 4 + 19 + 57 + 163 + 1 + 4 = 249.
#
##############################################################################

let $binlog_start_pos=248;
let $binlog_start_pos=249;
--disable_query_log
SET @binlog_start_pos=248;
SET @binlog_start_pos=249;
--enable_query_log

2 changes: 1 addition & 1 deletion mysql-test/include/show_binlog_events2.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if ($binlog_start)
}
if (!$binlog_start)
{
--let $_binlog_start=248
--let $_binlog_start=249
}
if ($binlog_file)
{
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/r/mysqld--help.result
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ The following options may be given as the first argument:
--div-precision-increment=#
Precision of the result of '/' operator will be increased
on that value
--encrypt-binlog Encrypt binary logs (including relay logs)
(Defaults to on; use --skip-encrypt-binlog to disable.)
--encrypt-tmp-disk-tables
Encrypt temporary on-disk tables (created as part of
query execution)
Expand Down Expand Up @@ -1170,6 +1172,7 @@ delayed-insert-limit 100
delayed-insert-timeout 300
delayed-queue-size 1000
div-precision-increment 4
encrypt-binlog TRUE
encrypt-tmp-disk-tables FALSE
encrypt-tmp-files TRUE
enforce-storage-engine (No default value)
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/rpl/r/rpl_checksum.result
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ insert into t1 values (1) /* will not be applied on slave due to simulation */;
set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
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.''
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.''
select count(*) as zero from t1;
zero
0
Expand Down
14 changes: 14 additions & 0 deletions mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,20 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ENCRYPT_BINLOG
SESSION_VALUE NULL
GLOBAL_VALUE ON
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE ON
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Encrypt binary logs (including relay logs)
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ENCRYPT_TMP_DISK_TABLES
SESSION_VALUE NULL
GLOBAL_VALUE OFF
Expand Down
Loading

0 comments on commit b85a001

Please sign in to comment.