polardbxengine/mysql-test/suite/group_replication/r/gr_key_rotation.result

94 lines
4.4 KiB
Plaintext

include/group_replication.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection server1]
set sql_log_bin=0;
set sql_log_bin=1;
ALTER INSTANCE ROTATE INNODB MASTER KEY;
ERROR HY000: Can't find master key from keyring, please check in the server log if a keyring plugin is loaded and initialized successfully.
INSTALL PLUGIN keyring_file SONAME 'keyring_file.so';
SET @@global.keyring_file_data='MYSQL_TMP_DIR/keyring_server1/keyring_server1';
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name='keyring_file';
PLUGIN_NAME keyring_file
PLUGIN_VERSION 1.0
PLUGIN_STATUS ACTIVE
ALTER INSTANCE ROTATE INNODB MASTER KEY;
include/start_and_bootstrap_group_replication.inc
CREATE TABLE t1(c1 INT PRIMARY KEY, c2 char(20)) ENCRYPTION="Y" ENGINE = InnoDB;
INSERT INTO t1 VALUES(1, "first");
INSERT INTO t1 VALUES(2, "second");
INSERT INTO t1 VALUES(3, "third");
CREATE TABLE t2 (c1 INT PRIMARY KEY,c2 INT,FOREIGN KEY(c2)REFERENCES t1(c1)ON DELETE RESTRICT);
INSERT INTO t2 VALUES(1,1);
INSERT INTO t2 VALUEs(2,2);
[connection server2]
set sql_log_bin=0;
set sql_log_bin=1;
ALTER INSTANCE ROTATE INNODB MASTER KEY;
ERROR HY000: Can't find master key from keyring, please check in the server log if a keyring plugin is loaded and initialized successfully.
INSTALL PLUGIN keyring_file SONAME 'keyring_file.so';
SET @@global.keyring_file_data='MYSQL_TMP_DIR/keyring_server2/keyring_server2';
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name='keyring_file';
PLUGIN_NAME keyring_file
PLUGIN_VERSION 1.0
PLUGIN_STATUS ACTIVE
include/start_group_replication.inc
UPDATE t2 SET c1=3 WHERE c1=2;
UPDATE t2 SET c2=NULL WHERE c2=3;
DELETE FROM t1 WHERE c1=3;
include/rpl_sync.inc
# check that t1 exists and has same values in both servers
include/diff_tables.inc [server1:t1, server2:t1]
# check that t2 exists and has same values in both servers
include/diff_tables.inc [server1:t2, server2:t2]
UNINSTALL PLUGIN keyring_file;
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name='keyring_file';
INSERT INTO t1 VALUES(7,'seventh');
CREATE TABLE t3(c1 INT PRIMARY KEY, c2 char(20)) ENCRYPTION="Y" ENGINE = InnoDB;
ERROR HY000: Can't find master key from keyring, please check in the server log if a keyring plugin is loaded and initialized successfully.
ALTER INSTANCE ROTATE INNODB MASTER KEY;
ERROR HY000: Can't find master key from keyring, please check in the server log if a keyring plugin is loaded and initialized successfully.
[connection server1]
CREATE TABLE t3(c1 INT PRIMARY KEY) ENCRYPTION="Y" ENGINE = InnoDB;
INSERT INTO t3 VALUES(1);
UPDATE t3 SET c1=2;
[connection server2]
SELECT * FROM t3;
ERROR 42S02: Table 'test.t3' doesn't exist
include/stop_group_replication.inc
INSTALL PLUGIN keyring_file SONAME 'keyring_file.so';
SET @@global.keyring_file_data='MYSQL_TMP_DIR/keyring_server2/keyring_server2';
SELECT PLUGIN_NAME,PLUGIN_VERSION,PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE plugin_name='keyring_file';
PLUGIN_NAME keyring_file
PLUGIN_VERSION 1.0
PLUGIN_STATUS ACTIVE
include/start_group_replication.inc
DELETE FROM t3 WHERE c1=1;
DELETE FROM t2 WHERE c1=1;
DELETE FROM t1 WHERE c1=1;
include/rpl_sync.inc
# check that t1 exists and has same values in both servers
include/diff_tables.inc [server1:t1, server2:t1]
# check that t2 exists and has same values in both servers
include/diff_tables.inc [server1:t2, server2:t2]
# check that t3 exists and has same values in both servers
[connection server1]
SET GLOBAL binlog_encryption=ON;
CREATE TABLE t4 (c1 TEXT,c2 INT AUTO_INCREMENT PRIMARY KEY);
# Adding debug point 'ensure_binlog_cache_temporary_file_is_encrypted' to @@GLOBAL.debug
INSERT INTO t4(c1) VALUES (REPEAT('123', 16384.0));
# Removing debug point 'ensure_binlog_cache_temporary_file_is_encrypted' from @@GLOBAL.debug
SET GLOBAL binlog_encryption = OFF;
include/rpl_sync.inc
# check that t4 exists and has same values in both servers
[connection server2]
UNINSTALL PLUGIN keyring_file;
[connection server1]
UNINSTALL PLUGIN keyring_file;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t1;
DROP TABLE t4;
include/group_replication_end.inc