Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS-9218: Merge MySQL 8.4.0 (replace keyring_file plugin with component_keyring_file in MTR tests) #5312

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions mysql-test/include/innodb_online_alter_encryption.inc
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ SHOW CREATE TABLE t6;
SHOW CREATE TABLE t7;

--echo # Restarting server
let $restart_parameters = restart: $KEYRING_PLUGIN_OPT $KEYRING_PLUGIN_LOAD --keyring_file_data=$MYSQL_TMP_DIR/mysecret_keyring
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR $KEYRING_PLUGIN keyring_file.so
--let $restart_parameters = restart:
--source include/restart_mysqld.inc
--echo # Done restarting server

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ t7 CREATE TABLE `t7` (
KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=COMPRESSED ENCRYPTION='y'
# Restarting server
# restart:<hidden args>
# Done restarting server
SELECT COUNT(1) FROM t1;
COUNT(1)
15000
SELECT COUNT(1) FROM t2;
COUNT(1)
15000
Expand Down
13 changes: 13 additions & 0 deletions mysql-test/suite/percona/r/bug_ps7923.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# ----------------------------------------------------------------------
# Setup
# Creating local configuration file for keyring component: component_keyring_file
# Creating manifest file for current MySQL server instance
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
CREATE PROCEDURE my_infinite_alter_ts()
BEGIN
WHILE TRUE DO
Expand All @@ -8,3 +14,10 @@ END//
CALL my_infinite_alter_ts();
# Kill and restart:<hidden args>
DROP PROCEDURE my_infinite_alter_ts;
# ----------------------------------------------------------------------
# Teardown
# Removing manifest file for current MySQL server instance
# Removing local keyring file for keyring component: component_keyring_file
# Removing local configuration file for keyring component: component_keyring_file
# Restarting server without the manifest file
# ----------------------------------------------------------------------
3 changes: 0 additions & 3 deletions mysql-test/suite/percona/t/bug_ps7923-master.opt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
$KEYRING_PLUGIN_LOAD_EARLY
--loose-keyring_file_data=$MYSQL_TMP_DIR/keyring
$KEYRING_PLUGIN_OPT
--gtid-mode=ON --enforce-gtid-consistency=ON
7 changes: 6 additions & 1 deletion mysql-test/suite/percona/t/bug_ps7923.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
--source include/have_component_keyring_file.inc
--source suite/component_keyring_file/inc/setup_component.inc

--connect (con1,localhost,root,,)

--connection default
Expand All @@ -22,9 +25,11 @@ DELIMITER ;//
--connection default

--let $do_not_echo_parameters = 1
--let $restart_parameters = restart: --gtid-mode=ON --enforce-gtid-consistency=ON $KEYRING_PLUGIN_LOAD_EARLY --loose-keyring_file_data=$MYSQL_TMP_DIR/keyring $KEYRING_PLUGIN_OPT
--let $restart_parameters = restart: --gtid-mode=ON --enforce-gtid-consistency=ON
--source include/kill_and_restart_mysqld.inc

--disconnect con1

DROP PROCEDURE my_infinite_alter_ts;

--source suite/component_keyring_file/inc/teardown_component.inc
13 changes: 13 additions & 0 deletions mysql-test/suite/percona_innodb/r/bug_ps8428.result
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# ----------------------------------------------------------------------
# Setup
# Creating local configuration file for keyring component: component_keyring_file
# Creating manifest file for current MySQL server instance
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a TEXT(500));
INSERT INTO t1 VALUES (0, 'A BC DEF GHIJ KLM NOPQRS TUV WXYZ 012 3456789');
ALTER TABLE t1 ADD FULLTEXT(a);
Warnings:
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
DROP TABLE t1;
# ----------------------------------------------------------------------
# Teardown
# Removing manifest file for current MySQL server instance
# Removing local keyring file for keyring component: component_keyring_file
# Removing local configuration file for keyring component: component_keyring_file
# Restarting server without the manifest file
# ----------------------------------------------------------------------
15 changes: 14 additions & 1 deletion mysql-test/suite/percona_innodb/r/encrypt_crash.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# ----------------------------------------------------------------------
# Setup
# Creating local configuration file for keyring component: component_keyring_file
# Creating manifest file for current MySQL server instance
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
#
# PS-5791 : crash recovery bug ut_dbg_assertion_failed "encryption.m_type == Encryption::AES"
#
Expand All @@ -13,8 +19,15 @@ Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
INSERT INTO t1 ( c0 ,c1 ,c2 ,c3 ,c4 ,c5 ,c6 ) VALUES( 27906, 'YyjVvM736Yv6DypI', 52002, 51934, 41805, 94851, 1200 );
# Kill and restart
# Kill and restart:<hidden args>
SELECT COUNT(*) FROM t1;
COUNT(*)
3
DROP TABLE t1;
# ----------------------------------------------------------------------
# Teardown
# Removing manifest file for current MySQL server instance
# Removing local keyring file for keyring component: component_keyring_file
# Removing local configuration file for keyring component: component_keyring_file
# Restarting server without the manifest file
# ----------------------------------------------------------------------
12 changes: 12 additions & 0 deletions mysql-test/suite/percona_innodb/r/encrypt_mysql_ibd.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# ----------------------------------------------------------------------
# Setup
# Creating custom global manifest file for MySQL server
# Creating custom global configuration file for keyring component: component_keyring_file
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
# create bootstrap file
# Bootstrap new instance with encrypted mysql.ibd
# Check Encryption header of mysql.ibd
Expand All @@ -6,3 +12,9 @@ include/assert.inc [Mysql.ibd should be encrypted]
# Check Encryption header of mysql.ibd after shutdown
# Start default MTR instance
# restart
# ----------------------------------------------------------------------
# Setup
# Creating custom global manifest file for MySQL server
# Creating custom global configuration file for keyring component: component_keyring_file
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
13 changes: 13 additions & 0 deletions mysql-test/suite/percona_innodb/r/force_encryption.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# ----------------------------------------------------------------------
# Setup
# Creating local configuration file for keyring component: component_keyring_file
# Creating manifest file for current MySQL server instance
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
create tablespace ts_unencrypted1 add datafile 'ts_unencrypted1.ibd' engine=innodb;
create tablespace ts_encrypted1 add datafile 'ts_encrypted1.ibd' engine=innodb encryption="Y";
create tablespace ts_encrypted2 add datafile 'ts_encrypted2.ibd' engine=innodb encryption="Y";
Expand Down Expand Up @@ -266,3 +272,10 @@ ALTER DATABASE db1 DEFAULT ENCRYPTION='N';
SET GLOBAL table_encryption_privilege_check = default;
DROP USER u1@localhost;
DROP DATABASE db1;
# ----------------------------------------------------------------------
# Teardown
# Removing manifest file for current MySQL server instance
# Removing local keyring file for keyring component: component_keyring_file
# Removing local configuration file for keyring component: component_keyring_file
# Restarting server without the manifest file
# ----------------------------------------------------------------------
13 changes: 13 additions & 0 deletions mysql-test/suite/percona_innodb/r/general_ts_encrypt.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# ----------------------------------------------------------------------
# Setup
# Creating local configuration file for keyring component: component_keyring_file
# Creating manifest file for current MySQL server instance
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
CREATE TABLESPACE ts_encrypted ADD DATAFILE 'ts_encrypted.ibd' ENCRYPTION="Y" ENGINE="InnoDB";
CREATE TABLESPACE ts_encrypted_new ADD DATAFILE 'ts_encrypted_new.ibd' ENCRYPTION="Y" ENGINE="InnoDB";
CREATE TABLESPACE ts_unencrypted ADD DATAFILE 'ts_unencrypted.ibd' ENGINE="InnoDB";
Expand Down Expand Up @@ -52,3 +58,10 @@ DROP TABLESPACE ts_encrypted;
DROP TABLESPACE ts_encrypted_new;
DROP TABLESPACE ts_unencrypted;
DROP TABLESPACE ts_unencrypted_new;
# ----------------------------------------------------------------------
# Teardown
# Removing manifest file for current MySQL server instance
# Removing local keyring file for keyring component: component_keyring_file
# Removing local configuration file for keyring component: component_keyring_file
# Restarting server without the manifest file
# ----------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
call mtr.add_suppression("Function 'keyring_file' already exists");
call mtr.add_suppression("Couldn't load plugin named 'keyring_file' with soname 'keyring_file.*'.");
call mtr.add_suppression("Plugin keyring_file reported");
# ----------------------------------------------------------------------
# Setup
# Creating local configuration file for keyring component: component_keyring_file
# Creating manifest file for current MySQL server instance
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
# restart:<hidden args>
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB ENCRYPTION='y';
CREATE TABLE t2 (id INT NOT NULL PRIMARY KEY, a VARCHAR(255)) ENGINE=InnoDB;
Expand Down Expand Up @@ -109,6 +112,11 @@ t7 CREATE TABLE `t7` (
KEY `b` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ROW_FORMAT=COMPRESSED ENCRYPTION='y'
# Restarting server
# restart:<hidden args>
# Done restarting server
SELECT COUNT(1) FROM t1;
COUNT(1)
15000
SELECT COUNT(1) FROM t2;
COUNT(1)
15000
Expand All @@ -129,3 +137,10 @@ COUNT(1)
15000
DROP PROCEDURE innodb_insert_proc;
DROP TABLE t1, t2, t3, t4, t5, t6, t7;
# ----------------------------------------------------------------------
# Teardown
# Removing manifest file for current MySQL server instance
# Removing local keyring file for keyring component: component_keyring_file
# Removing local configuration file for keyring component: component_keyring_file
# Restarting server without the manifest file
# ----------------------------------------------------------------------
16 changes: 13 additions & 3 deletions mysql-test/suite/percona_innodb/r/innodb_row_log_encryption.result
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
call mtr.add_suppression("Function 'keyring_file' already exists");
call mtr.add_suppression("Couldn't load plugin named 'keyring_file' with soname 'keyring_file.*'.");
call mtr.add_suppression("Plugin keyring_file reported");
# ----------------------------------------------------------------------
# Setup
# Creating local configuration file for keyring component: component_keyring_file
# Creating manifest file for current MySQL server instance
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
# restart:<hidden args>
CREATE TABLE t1(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, credit_card VARCHAR(200), private VARCHAR(50)) ENGINE=InnoDB ENCRYPTION='y';
SET DEBUG_SYNC= 'ddl_after_scan SIGNAL opened WAIT_FOR rotated';
Expand Down Expand Up @@ -40,3 +43,10 @@ SET DEBUG_SYNC= 'now WAIT_FOR paused';
SET DEBUG_SYNC= 'now SIGNAL unpause';
DROP TABLE t;
SET DEBUG_SYNC= 'RESET';
# ----------------------------------------------------------------------
# Teardown
# Removing manifest file for current MySQL server instance
# Removing local keyring file for keyring component: component_keyring_file
# Removing local configuration file for keyring component: component_keyring_file
# Restarting server without the manifest file
# ----------------------------------------------------------------------
17 changes: 15 additions & 2 deletions mysql-test/suite/percona_innodb/r/parallel_dblwr_encrypt.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# ----------------------------------------------------------------------
# Setup
# Creating local configuration file for keyring component: component_keyring_file
# Creating manifest file for current MySQL server instance
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
CREATE TABLE t1(a TEXT) ENCRYPTION='N';
CREATE TABLE t2(a TEXT) ENCRYPTION='N';
CREATE TABLE t3(a TEXT) ENCRYPTION='N';
Expand Down Expand Up @@ -25,7 +31,7 @@ INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occu
# Kill the server
# Writes to Parallel dblwr are not encrypted, so it should be "Pattern found"
Pattern found.
# restart
# restart:<hidden args>
DROP TABLE t1, t2, t3;
CREATE TABLE t1(a TEXT) ENCRYPTION='Y';
CREATE TABLE t2(a TEXT) ENCRYPTION='Y';
Expand Down Expand Up @@ -54,5 +60,12 @@ INSERT INTO t3 (a) VALUES ('Abracadabra is of unknown origin, and its first occu
# Kill the server
# Writes to Parallel dblwr are encrypted, so it should be "Pattern not found"
Pattern not found.
# restart
# restart:<hidden args>
DROP TABLE t1, t2, t3;
# ----------------------------------------------------------------------
# Teardown
# Removing manifest file for current MySQL server instance
# Removing local keyring file for keyring component: component_keyring_file
# Removing local configuration file for keyring component: component_keyring_file
# Restarting server without the manifest file
# ----------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# restart
# ----------------------------------------------------------------------
# Setup
# Creating local configuration file for keyring component: component_keyring_file
# Creating manifest file for current MySQL server instance
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
SELECT @@innodb_temp_tablespace_encrypt;
@@innodb_temp_tablespace_encrypt
0
Expand Down Expand Up @@ -101,3 +106,10 @@ DROP TABLE t3;
DROP TABLE t6;
include/assert.inc [Active session temp tablespaces count should be 2]
include/assert.inc [Inactive session temp tablespaces count should be 8]
# ----------------------------------------------------------------------
# Teardown
# Removing manifest file for current MySQL server instance
# Removing local keyring file for keyring component: component_keyring_file
# Removing local configuration file for keyring component: component_keyring_file
# Restarting server without the manifest file
# ----------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# ----------------------------------------------------------------------
# Setup
# Creating custom global manifest file for MySQL server
# Creating custom global configuration file for keyring component: component_keyring_file
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
# Stop the instance which was created by MTR
# create bootstrap file
# Bootstrap new instance with default_table_encryption=ON
Expand Down Expand Up @@ -28,3 +34,9 @@ SPACE PURPOSE
DROP DATABASE db1;
# Start default MTR instance
# restart
# ----------------------------------------------------------------------
# Setup
# Creating custom global manifest file for MySQL server
# Creating custom global configuration file for keyring component: component_keyring_file
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
18 changes: 14 additions & 4 deletions mysql-test/suite/percona_innodb/r/sys_tablespace_encrypt.result
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# ----------------------------------------------------------------------
# Setup
# Creating custom global manifest file for MySQL server
# Creating custom global configuration file for keyring component: component_keyring_file
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
call mtr.add_suppression("Found 1 prepared XA transactions");
SET @save_default_table_encryption=@@default_table_encryption;
CREATE DATABASE db1;
Expand Down Expand Up @@ -74,15 +80,13 @@ DROP TABLESPACE tb01;
# Stop the instance which was created by MTR
# create bootstrap file
# start unencrypted system with --innodb-sys-tablespace-encrypt=ON
# Taking backup of global manifest file for MySQL server
Pattern found.
# Restore global manifest file for MySQL server from backup
# Bootstrap new instance with encrypted system tablespace
# Check Encryption header of ibdata1
# Start encrypted system with --innodb-sys-tablespace-encrypt=OFF
Pattern found.
# Start encrypted system without early-plugin-load and only --plugin-load
Pattern found.
# Start encrypted system without keyring_data
Pattern found.
# Start the instance with encrypted system tablespace
# restart: --datadir=MYSQLD_DATADIR1 --innodb-sys-tablespace-encrypt=ON
SELECT @@innodb_sys_tablespace_encrypt;
Expand Down Expand Up @@ -316,3 +320,9 @@ SET PERSIST innodb_sys_tablespace_encrypt = ON;
ERROR HY000: Variable 'innodb_sys_tablespace_encrypt' is a read only variable
SET PERSIST innodb_sys_tablespace_encrypt = OFF;
ERROR HY000: Variable 'innodb_sys_tablespace_encrypt' is a read only variable
# ----------------------------------------------------------------------
# Setup
# Creating custom global manifest file for MySQL server
# Creating custom global configuration file for keyring component: component_keyring_file
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
13 changes: 13 additions & 0 deletions mysql-test/suite/percona_innodb/r/tablespace_encrypt.result
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# ----------------------------------------------------------------------
# Setup
# Creating local configuration file for keyring component: component_keyring_file
# Creating manifest file for current MySQL server instance
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
CREATE TABLESPACE tab_enc ADD DATAFILE 'tab_enc.ibd' ENCRYPTION='Y';
CREATE TABLE t1 (i INT primary key) ENCRYPTION='Y' TABLESPACE=tab_enc;
ALTER TABLESPACE tab_enc ENCRYPTION 'N';
ALTER TABLE t1 RENAME COLUMN i TO i_rename, ALGORITHM=INPLACE;
DROP TABLE t1;
DROP TABLESPACE tab_enc;
# ----------------------------------------------------------------------
# Teardown
# Removing manifest file for current MySQL server instance
# Removing local keyring file for keyring component: component_keyring_file
# Removing local configuration file for keyring component: component_keyring_file
# Restarting server without the manifest file
# ----------------------------------------------------------------------
15 changes: 14 additions & 1 deletion mysql-test/suite/percona_innodb/r/temp_table_encrypt.result
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ SELECT @@innodb_temp_tablespace_encrypt;
include/assert.inc [Temporary tablespace should be unencrypted]
# startup failure when innodb_temp_tablespace =ON and no keyring plugin
Pattern found.
# restart:<hidden args>
# restart
# ----------------------------------------------------------------------
# Setup
# Creating local configuration file for keyring component: component_keyring_file
# Creating manifest file for current MySQL server instance
# Re-starting mysql server with manifest file
# ----------------------------------------------------------------------
CREATE TABLE t1 (a INT, b BLOB);
INSERT INTO t1 VALUES (1, 'hello'), (2, 'hi'), (3, 'satya');
SET GLOBAL default_table_encryption=ON;
Expand All @@ -71,3 +77,10 @@ CREATE TEMPORARY TABLE t01 (a INT) ENGINE=InnoDB;
INSERT INTO t01 VALUES (1), (2), (3);
SET GLOBAL innodb_temp_tablespace_encrypt = OFF;
include/assert.inc [Temporary tablespace should be encrypted. Once encrypted, it cannot be unencrypted]
# ----------------------------------------------------------------------
# Teardown
# Removing manifest file for current MySQL server instance
# Removing local keyring file for keyring component: component_keyring_file
# Removing local configuration file for keyring component: component_keyring_file
# Restarting server without the manifest file
# ----------------------------------------------------------------------
Loading
Loading