summaryrefslogtreecommitdiff
path: root/mysql-test/suite/encryption/t/innodb-encryption-alter.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/encryption/t/innodb-encryption-alter.test')
-rw-r--r--mysql-test/suite/encryption/t/innodb-encryption-alter.test38
1 files changed, 29 insertions, 9 deletions
diff --git a/mysql-test/suite/encryption/t/innodb-encryption-alter.test b/mysql-test/suite/encryption/t/innodb-encryption-alter.test
index e8391d97d6c..a6a4dbaff9b 100644
--- a/mysql-test/suite/encryption/t/innodb-encryption-alter.test
+++ b/mysql-test/suite/encryption/t/innodb-encryption-alter.test
@@ -1,13 +1,12 @@
-- source include/have_innodb.inc
+-- source include/have_debug.inc
+-- source include/have_debug_sync.inc
-- source include/have_file_key_management_plugin.inc
#
# MDEV-8817: Failing assertion: new_state->key_version != ENCRYPTION_KEY_VERSION_INVALID
#
-let $encrypt_tables = `SELECT @@innodb_encrypt_tables`;
-let $threads = `SELECT @@innodb_encryption_threads`;
-
SET GLOBAL innodb_encrypt_tables = ON;
SET GLOBAL innodb_encryption_threads = 4;
@@ -99,14 +98,35 @@ ALTER TABLE t2 ENCRYPTION_KEY_ID=4, ALGORITHM=COPY;
--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
SHOW WARNINGS;
SHOW CREATE TABLE t2;
-DROP TABLE t2;
--error ER_CANT_CREATE_TABLE
CREATE TABLE t3 (a int not null primary key) engine=innodb ENCRYPTION_KEY_ID=4;
SHOW WARNINGS;
-# reset system
---disable_query_log
-EVAL SET GLOBAL innodb_encrypt_tables = $encrypt_tables;
-EVAL SET GLOBAL innodb_encryption_threads = $threads;
---enable_query_log
+FLUSH TABLES;
+
+create table t1(f1 int not null, f2 int not null)engine=innodb encrypted=yes;
+insert into t1 values(1, 2), (2, 3), (4, 5), (5, 6), (7, 8);
+insert into t1 select * from t1;
+BEGIN;
+INSERT INTO t2 VALUES (1);
+
+connect con1, localhost, root;
+SET DEBUG_SYNC = 'row_log_table_apply2_before SIGNAL done WAIT_FOR ever';
+send alter table t1 force;
+
+connection default;
+SET DEBUG_SYNC = 'now WAIT_FOR done';
+SET GLOBAL innodb_flush_log_at_trx_commit=1;
+COMMIT;
+
+--let $shutdown_timeout= 0
+--source include/restart_mysqld.inc
+disconnect con1;
+
+select * from t1;
+drop table t1,t2;
+
+# Work around missing crash recovery at the SQL layer.
+let $datadir= `select @@datadir`;
+--remove_files_wildcard $datadir/test #sql-*.frm