diff --git a/mysql-test/suite/innodb/t/a000-master.opt b/mysql-test/suite/innodb/t/a000-master.opt new file mode 100644 index 00000000000..a4eadf0d247 --- /dev/null +++ b/mysql-test/suite/innodb/t/a000-master.opt @@ -0,0 +1,3 @@ +$KEYRING_PLUGIN_LOAD_EARLY +$KEYRING_PLUGIN_OPT +--loose-keyring-file-data=$MYSQL_TMP_DIR/my_keyring diff --git a/mysql-test/suite/innodb/t/a000.test b/mysql-test/suite/innodb/t/a000.test new file mode 100644 index 00000000000..ebddbb3ccb3 --- /dev/null +++ b/mysql-test/suite/innodb/t/a000.test @@ -0,0 +1,20 @@ +--source include/have_debug_sync.inc + +SET debug_sync = 'alter_encrypt_tablespace_wait_after_page0 WAIT_FOR s1'; +--send ALTER TABLESPACE mysql ENCRYPTION='Y' + +--connect(con1, localhost, root,,) +--connection con1 +CREATE TABLE t1(id INT UNSIGNED NOT NULL) ENGINE=InnoDB, ENCRYPTION='Y'; +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +--sleep 3 + +--source include/kill_mysqld.inc + +--connection default +--error CR_SERVER_LOST +--reap + +--source include/start_mysqld.inc + diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc index 3ad8962c98d..4acbac6f10f 100644 --- a/storage/innobase/fsp/fsp0fsp.cc +++ b/storage/innobase/fsp/fsp0fsp.cc @@ -4248,6 +4248,8 @@ static dberr_t encrypt_begin_persist(fil_space_t *space) { ut_d(ut_error); } + DEBUG_SYNC(current_thd, "alter_encrypt_tablespace_wait_after_page0"); + /* Write operation type and progress (0 now) on page 0 */ fsp_header_write_encryption_progress( space->id, space->flags, 0, Encryption::ENCRYPT_IN_PROGRESS, true, &mtr); @@ -4440,6 +4442,9 @@ static dberr_t decrypt_begin_persist(fil_space_t *space) { } mtr_commit(&mtr); + + DEBUG_SYNC(current_thd, "alter_decrypt_tablespace_wait_after_page0"); + return err; }